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 transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the connector that's identified by the ConnectorId. func (c *Client) DescribeConnector(ctx context.Context, params *DescribeConnectorInput, optFns ...func(*Options)) (*DescribeConnectorOutput, error) { if params == nil { params = &DescribeConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeConnector", params, optFns, c.addOperationDescribeConnectorMiddlewares) if err != nil { return nil, err } out := result.(*DescribeConnectorOutput) out.ResultMetadata = metadata return out, nil } type DescribeConnectorInput struct { // The unique identifier for the connector. // // This member is required. ConnectorId *string noSmithyDocumentSerde } type DescribeConnectorOutput struct { // The structure that contains the details of the connector. // // This member is required. Connector *types.DescribedConnector // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeConnector{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConnector(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeConnector", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // You can use DescribeExecution to check the details of the execution of the // specified workflow. This API call only returns details for in-progress // workflows. If you provide an ID for an execution that is not in progress, or if // the execution doesn't match the specified workflow ID, you receive a // ResourceNotFound exception. func (c *Client) DescribeExecution(ctx context.Context, params *DescribeExecutionInput, optFns ...func(*Options)) (*DescribeExecutionOutput, error) { if params == nil { params = &DescribeExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeExecution", params, optFns, c.addOperationDescribeExecutionMiddlewares) if err != nil { return nil, err } out := result.(*DescribeExecutionOutput) out.ResultMetadata = metadata return out, nil } type DescribeExecutionInput struct { // A unique identifier for the execution of a workflow. // // This member is required. ExecutionId *string // A unique identifier for the workflow. // // This member is required. WorkflowId *string noSmithyDocumentSerde } type DescribeExecutionOutput struct { // The structure that contains the details of the workflow' execution. // // This member is required. Execution *types.DescribedExecution // A unique identifier for the workflow. // // This member is required. WorkflowId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeExecution", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the details of the host key that's specified by the HostKeyId and // ServerId . func (c *Client) DescribeHostKey(ctx context.Context, params *DescribeHostKeyInput, optFns ...func(*Options)) (*DescribeHostKeyOutput, error) { if params == nil { params = &DescribeHostKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeHostKey", params, optFns, c.addOperationDescribeHostKeyMiddlewares) if err != nil { return nil, err } out := result.(*DescribeHostKeyOutput) out.ResultMetadata = metadata return out, nil } type DescribeHostKeyInput struct { // The identifier of the host key that you want described. // // This member is required. HostKeyId *string // The identifier of the server that contains the host key that you want described. // // This member is required. ServerId *string noSmithyDocumentSerde } type DescribeHostKeyOutput struct { // Returns the details for the specified host key. // // This member is required. HostKey *types.DescribedHostKey // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeHostKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeHostKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeHostKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeHostKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHostKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeHostKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeHostKey", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the details of the profile that's specified by the ProfileId . func (c *Client) DescribeProfile(ctx context.Context, params *DescribeProfileInput, optFns ...func(*Options)) (*DescribeProfileOutput, error) { if params == nil { params = &DescribeProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeProfile", params, optFns, c.addOperationDescribeProfileMiddlewares) if err != nil { return nil, err } out := result.(*DescribeProfileOutput) out.ResultMetadata = metadata return out, nil } type DescribeProfileInput struct { // The identifier of the profile that you want described. // // This member is required. ProfileId *string noSmithyDocumentSerde } type DescribeProfileOutput struct { // The details of the specified profile, returned as an object. // // This member is required. Profile *types.DescribedProfile // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeProfile", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the security policy that is attached to your file transfer // protocol-enabled server. The response contains a description of the security // policy's properties. For more information about security policies, see Working // with security policies (https://docs.aws.amazon.com/transfer/latest/userguide/security-policies.html) // . func (c *Client) DescribeSecurityPolicy(ctx context.Context, params *DescribeSecurityPolicyInput, optFns ...func(*Options)) (*DescribeSecurityPolicyOutput, error) { if params == nil { params = &DescribeSecurityPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityPolicy", params, optFns, c.addOperationDescribeSecurityPolicyMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSecurityPolicyOutput) out.ResultMetadata = metadata return out, nil } type DescribeSecurityPolicyInput struct { // Specifies the name of the security policy that is attached to the server. // // This member is required. SecurityPolicyName *string noSmithyDocumentSerde } type DescribeSecurityPolicyOutput struct { // An array containing the properties of the security policy. // // This member is required. SecurityPolicy *types.DescribedSecurityPolicy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSecurityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSecurityPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSecurityPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSecurityPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSecurityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeSecurityPolicy", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Describes a file transfer protocol-enabled server that you specify by passing // the ServerId parameter. The response contains a description of a server's // properties. When you set EndpointType to VPC, the response will contain the // EndpointDetails . func (c *Client) DescribeServer(ctx context.Context, params *DescribeServerInput, optFns ...func(*Options)) (*DescribeServerOutput, error) { if params == nil { params = &DescribeServerInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeServer", params, optFns, c.addOperationDescribeServerMiddlewares) if err != nil { return nil, err } out := result.(*DescribeServerOutput) out.ResultMetadata = metadata return out, nil } type DescribeServerInput struct { // A system-assigned unique identifier for a server. // // This member is required. ServerId *string noSmithyDocumentSerde } type DescribeServerOutput struct { // An array containing the properties of a server with the ServerID you specified. // // This member is required. Server *types.DescribedServer // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeServerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeServer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeServer{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeServerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeServer(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeServerAPIClient is a client that implements the DescribeServer // operation. type DescribeServerAPIClient interface { DescribeServer(context.Context, *DescribeServerInput, ...func(*Options)) (*DescribeServerOutput, error) } var _ DescribeServerAPIClient = (*Client)(nil) // ServerOfflineWaiterOptions are waiter options for ServerOfflineWaiter type ServerOfflineWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // MinDelay is the minimum amount of time to delay between retries. If unset, // ServerOfflineWaiter will use default minimum delay of 30 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ServerOfflineWaiter will use default max delay of 120 seconds. Note // that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeServerInput, *DescribeServerOutput, error) (bool, error) } // ServerOfflineWaiter defines the waiters for ServerOffline type ServerOfflineWaiter struct { client DescribeServerAPIClient options ServerOfflineWaiterOptions } // NewServerOfflineWaiter constructs a ServerOfflineWaiter. func NewServerOfflineWaiter(client DescribeServerAPIClient, optFns ...func(*ServerOfflineWaiterOptions)) *ServerOfflineWaiter { options := ServerOfflineWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = serverOfflineStateRetryable for _, fn := range optFns { fn(&options) } return &ServerOfflineWaiter{ client: client, options: options, } } // Wait calls the waiter function for ServerOffline waiter. The maxWaitDur is the // maximum wait duration the waiter will wait. The maxWaitDur is required and must // be greater than zero. func (w *ServerOfflineWaiter) Wait(ctx context.Context, params *DescribeServerInput, maxWaitDur time.Duration, optFns ...func(*ServerOfflineWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ServerOffline waiter and returns // the output of the successful operation. The maxWaitDur is the maximum wait // duration the waiter will wait. The maxWaitDur is required and must be greater // than zero. func (w *ServerOfflineWaiter) WaitForOutput(ctx context.Context, params *DescribeServerInput, maxWaitDur time.Duration, optFns ...func(*ServerOfflineWaiterOptions)) (*DescribeServerOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeServer(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ServerOffline waiter") } func serverOfflineStateRetryable(ctx context.Context, input *DescribeServerInput, output *DescribeServerOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Server.State", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "OFFLINE" value, ok := pathValue.(types.State) if !ok { return false, fmt.Errorf("waiter comparator expected types.State value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Server.State", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "STOP_FAILED" value, ok := pathValue.(types.State) if !ok { return false, fmt.Errorf("waiter comparator expected types.State value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } return true, nil } // ServerOnlineWaiterOptions are waiter options for ServerOnlineWaiter type ServerOnlineWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // MinDelay is the minimum amount of time to delay between retries. If unset, // ServerOnlineWaiter will use default minimum delay of 30 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ServerOnlineWaiter will use default max delay of 120 seconds. Note // that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeServerInput, *DescribeServerOutput, error) (bool, error) } // ServerOnlineWaiter defines the waiters for ServerOnline type ServerOnlineWaiter struct { client DescribeServerAPIClient options ServerOnlineWaiterOptions } // NewServerOnlineWaiter constructs a ServerOnlineWaiter. func NewServerOnlineWaiter(client DescribeServerAPIClient, optFns ...func(*ServerOnlineWaiterOptions)) *ServerOnlineWaiter { options := ServerOnlineWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = serverOnlineStateRetryable for _, fn := range optFns { fn(&options) } return &ServerOnlineWaiter{ client: client, options: options, } } // Wait calls the waiter function for ServerOnline waiter. The maxWaitDur is the // maximum wait duration the waiter will wait. The maxWaitDur is required and must // be greater than zero. func (w *ServerOnlineWaiter) Wait(ctx context.Context, params *DescribeServerInput, maxWaitDur time.Duration, optFns ...func(*ServerOnlineWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ServerOnline waiter and returns the // output of the successful operation. The maxWaitDur is the maximum wait duration // the waiter will wait. The maxWaitDur is required and must be greater than zero. func (w *ServerOnlineWaiter) WaitForOutput(ctx context.Context, params *DescribeServerInput, maxWaitDur time.Duration, optFns ...func(*ServerOnlineWaiterOptions)) (*DescribeServerOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeServer(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ServerOnline waiter") } func serverOnlineStateRetryable(ctx context.Context, input *DescribeServerInput, output *DescribeServerOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Server.State", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "ONLINE" value, ok := pathValue.(types.State) if !ok { return false, fmt.Errorf("waiter comparator expected types.State value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Server.State", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "START_FAILED" value, ok := pathValue.(types.State) if !ok { return false, fmt.Errorf("waiter comparator expected types.State value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } return true, nil } func newServiceMetadataMiddleware_opDescribeServer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeServer", } }
496
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the user assigned to the specific file transfer protocol-enabled // server, as identified by its ServerId property. The response from this call // returns the properties of the user associated with the ServerId value that was // specified. func (c *Client) DescribeUser(ctx context.Context, params *DescribeUserInput, optFns ...func(*Options)) (*DescribeUserOutput, error) { if params == nil { params = &DescribeUserInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeUser", params, optFns, c.addOperationDescribeUserMiddlewares) if err != nil { return nil, err } out := result.(*DescribeUserOutput) out.ResultMetadata = metadata return out, nil } type DescribeUserInput struct { // A system-assigned unique identifier for a server that has this user assigned. // // This member is required. ServerId *string // The name of the user assigned to one or more servers. User names are part of // the sign-in credentials to use the Transfer Family service and perform file // transfer tasks. // // This member is required. UserName *string noSmithyDocumentSerde } type DescribeUserOutput struct { // A system-assigned unique identifier for a server that has this user assigned. // // This member is required. ServerId *string // An array containing the properties of the Transfer Family user for the ServerID // value that you specified. // // This member is required. User *types.DescribedUser // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeUser(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDescribeUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeUser", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the specified workflow. func (c *Client) DescribeWorkflow(ctx context.Context, params *DescribeWorkflowInput, optFns ...func(*Options)) (*DescribeWorkflowOutput, error) { if params == nil { params = &DescribeWorkflowInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorkflow", params, optFns, c.addOperationDescribeWorkflowMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorkflowOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorkflowInput struct { // A unique identifier for the workflow. // // This member is required. WorkflowId *string noSmithyDocumentSerde } type DescribeWorkflowOutput struct { // The structure that contains the details of the workflow. // // This member is required. Workflow *types.DescribedWorkflow // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorkflowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeWorkflow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeWorkflow{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeWorkflowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkflow(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeWorkflow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "DescribeWorkflow", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Imports the signing and encryption certificates that you need to create local // (AS2) profiles and partner profiles. func (c *Client) ImportCertificate(ctx context.Context, params *ImportCertificateInput, optFns ...func(*Options)) (*ImportCertificateOutput, error) { if params == nil { params = &ImportCertificateInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportCertificate", params, optFns, c.addOperationImportCertificateMiddlewares) if err != nil { return nil, err } out := result.(*ImportCertificateOutput) out.ResultMetadata = metadata return out, nil } type ImportCertificateInput struct { // - For the CLI, provide a file path for a certificate in URI format. For // example, --certificate file://encryption-cert.pem . Alternatively, you can // provide the raw content. // - For the SDK, specify the raw content of a certificate file. For example, // --certificate "`cat encryption-cert.pem`" . // // This member is required. Certificate *string // Specifies whether this certificate is used for signing or encryption. // // This member is required. Usage types.CertificateUsageType // An optional date that specifies when the certificate becomes active. ActiveDate *time.Time // An optional list of certificates that make up the chain for the certificate // that's being imported. CertificateChain *string // A short description that helps identify the certificate. Description *string // An optional date that specifies when the certificate becomes inactive. InactiveDate *time.Time // - For the CLI, provide a file path for a private key in URI format.For // example, --private-key file://encryption-key.pem . Alternatively, you can // provide the raw content of the private key file. // - For the SDK, specify the raw content of a private key file. For example, // --private-key "`cat encryption-key.pem`" PrivateKey *string // Key-value pairs that can be used to group and search for certificates. Tags []types.Tag noSmithyDocumentSerde } type ImportCertificateOutput struct { // An array of identifiers for the imported certificates. You use this identifier // for working with profiles and partner profiles. // // This member is required. CertificateId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportCertificate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportCertificate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportCertificateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportCertificate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportCertificate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ImportCertificate", } }
162
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a host key to the server that's specified by the ServerId parameter. func (c *Client) ImportHostKey(ctx context.Context, params *ImportHostKeyInput, optFns ...func(*Options)) (*ImportHostKeyOutput, error) { if params == nil { params = &ImportHostKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportHostKey", params, optFns, c.addOperationImportHostKeyMiddlewares) if err != nil { return nil, err } out := result.(*ImportHostKeyOutput) out.ResultMetadata = metadata return out, nil } type ImportHostKeyInput struct { // The private key portion of an SSH key pair. Transfer Family accepts RSA, ECDSA, // and ED25519 keys. // // This member is required. HostKeyBody *string // The identifier of the server that contains the host key that you are importing. // // This member is required. ServerId *string // The text description that identifies this host key. Description *string // Key-value pairs that can be used to group and search for host keys. Tags []types.Tag noSmithyDocumentSerde } type ImportHostKeyOutput struct { // Returns the host key identifier for the imported key. // // This member is required. HostKeyId *string // Returns the server identifier that contains the imported key. // // This member is required. ServerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportHostKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportHostKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportHostKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportHostKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportHostKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportHostKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ImportHostKey", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a Secure Shell (SSH) public key to a Transfer Family user identified by a // UserName value assigned to the specific file transfer protocol-enabled server, // identified by ServerId . The response returns the UserName value, the ServerId // value, and the name of the SshPublicKeyId . func (c *Client) ImportSshPublicKey(ctx context.Context, params *ImportSshPublicKeyInput, optFns ...func(*Options)) (*ImportSshPublicKeyOutput, error) { if params == nil { params = &ImportSshPublicKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportSshPublicKey", params, optFns, c.addOperationImportSshPublicKeyMiddlewares) if err != nil { return nil, err } out := result.(*ImportSshPublicKeyOutput) out.ResultMetadata = metadata return out, nil } type ImportSshPublicKeyInput struct { // A system-assigned unique identifier for a server. // // This member is required. ServerId *string // The public key portion of an SSH key pair. Transfer Family accepts RSA, ECDSA, // and ED25519 keys. // // This member is required. SshPublicKeyBody *string // The name of the Transfer Family user that is assigned to one or more servers. // // This member is required. UserName *string noSmithyDocumentSerde } // Identifies the user, the server they belong to, and the identifier of the SSH // public key associated with that user. A user can have more than one key on each // server that they are associated with. type ImportSshPublicKeyOutput struct { // A system-assigned unique identifier for a server. // // This member is required. ServerId *string // The name given to a public key by the system that was imported. // // This member is required. SshPublicKeyId *string // A user name assigned to the ServerID value that you specified. // // This member is required. UserName *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportSshPublicKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportSshPublicKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportSshPublicKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportSshPublicKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportSshPublicKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportSshPublicKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ImportSshPublicKey", } }
153
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the details for all the accesses you have on your server. func (c *Client) ListAccesses(ctx context.Context, params *ListAccessesInput, optFns ...func(*Options)) (*ListAccessesOutput, error) { if params == nil { params = &ListAccessesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAccesses", params, optFns, c.addOperationListAccessesMiddlewares) if err != nil { return nil, err } out := result.(*ListAccessesOutput) out.ResultMetadata = metadata return out, nil } type ListAccessesInput struct { // A system-assigned unique identifier for a server that has users assigned to it. // // This member is required. ServerId *string // Specifies the maximum number of access SIDs to return. MaxResults *int32 // When you can get additional results from the ListAccesses call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional accesses. NextToken *string noSmithyDocumentSerde } type ListAccessesOutput struct { // Returns the accesses and their properties for the ServerId value that you // specify. // // This member is required. Accesses []types.ListedAccess // A system-assigned unique identifier for a server that has users assigned to it. // // This member is required. ServerId *string // When you can get additional results from the ListAccesses call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional accesses. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAccessesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccesses{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccesses{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAccessesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccesses(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAccessesAPIClient is a client that implements the ListAccesses operation. type ListAccessesAPIClient interface { ListAccesses(context.Context, *ListAccessesInput, ...func(*Options)) (*ListAccessesOutput, error) } var _ ListAccessesAPIClient = (*Client)(nil) // ListAccessesPaginatorOptions is the paginator options for ListAccesses type ListAccessesPaginatorOptions struct { // Specifies the maximum number of access SIDs to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAccessesPaginator is a paginator for ListAccesses type ListAccessesPaginator struct { options ListAccessesPaginatorOptions client ListAccessesAPIClient params *ListAccessesInput nextToken *string firstPage bool } // NewListAccessesPaginator returns a new ListAccessesPaginator func NewListAccessesPaginator(client ListAccessesAPIClient, params *ListAccessesInput, optFns ...func(*ListAccessesPaginatorOptions)) *ListAccessesPaginator { if params == nil { params = &ListAccessesInput{} } options := ListAccessesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAccessesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccessesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccesses page. func (p *ListAccessesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessesOutput, 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.ListAccesses(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_opListAccesses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListAccesses", } }
236
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the agreements for the server that's identified by the // ServerId that you supply. If you want to limit the results to a certain number, // supply a value for the MaxResults parameter. If you ran the command previously // and received a value for NextToken , you can supply that value to continue // listing agreements from where you left off. func (c *Client) ListAgreements(ctx context.Context, params *ListAgreementsInput, optFns ...func(*Options)) (*ListAgreementsOutput, error) { if params == nil { params = &ListAgreementsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAgreements", params, optFns, c.addOperationListAgreementsMiddlewares) if err != nil { return nil, err } out := result.(*ListAgreementsOutput) out.ResultMetadata = metadata return out, nil } type ListAgreementsInput struct { // The identifier of the server for which you want a list of agreements. // // This member is required. ServerId *string // The maximum number of agreements to return. MaxResults *int32 // When you can get additional results from the ListAgreements call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional agreements. NextToken *string noSmithyDocumentSerde } type ListAgreementsOutput struct { // Returns an array, where each item contains the details of an agreement. // // This member is required. Agreements []types.ListedAgreement // Returns a token that you can use to call ListAgreements again and receive // additional results, if there are any. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAgreementsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAgreements{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAgreements{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAgreementsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAgreements(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAgreementsAPIClient is a client that implements the ListAgreements // operation. type ListAgreementsAPIClient interface { ListAgreements(context.Context, *ListAgreementsInput, ...func(*Options)) (*ListAgreementsOutput, error) } var _ ListAgreementsAPIClient = (*Client)(nil) // ListAgreementsPaginatorOptions is the paginator options for ListAgreements type ListAgreementsPaginatorOptions struct { // The maximum number of agreements to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAgreementsPaginator is a paginator for ListAgreements type ListAgreementsPaginator struct { options ListAgreementsPaginatorOptions client ListAgreementsAPIClient params *ListAgreementsInput nextToken *string firstPage bool } // NewListAgreementsPaginator returns a new ListAgreementsPaginator func NewListAgreementsPaginator(client ListAgreementsAPIClient, params *ListAgreementsInput, optFns ...func(*ListAgreementsPaginatorOptions)) *ListAgreementsPaginator { if params == nil { params = &ListAgreementsInput{} } options := ListAgreementsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAgreementsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAgreementsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAgreements page. func (p *ListAgreementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAgreementsOutput, 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.ListAgreements(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_opListAgreements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListAgreements", } }
234
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the current certificates that have been imported into // Transfer Family. If you want to limit the results to a certain number, supply a // value for the MaxResults parameter. If you ran the command previously and // received a value for the NextToken parameter, you can supply that value to // continue listing certificates from where you left off. func (c *Client) ListCertificates(ctx context.Context, params *ListCertificatesInput, optFns ...func(*Options)) (*ListCertificatesOutput, error) { if params == nil { params = &ListCertificatesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCertificates", params, optFns, c.addOperationListCertificatesMiddlewares) if err != nil { return nil, err } out := result.(*ListCertificatesOutput) out.ResultMetadata = metadata return out, nil } type ListCertificatesInput struct { // The maximum number of certificates to return. MaxResults *int32 // When you can get additional results from the ListCertificates call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional certificates. NextToken *string noSmithyDocumentSerde } type ListCertificatesOutput struct { // Returns an array of the certificates that are specified in the ListCertificates // call. // // This member is required. Certificates []types.ListedCertificate // Returns the next token, which you can use to list the next certificate. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCertificatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCertificates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCertificates{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListCertificates(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCertificatesAPIClient is a client that implements the ListCertificates // operation. type ListCertificatesAPIClient interface { ListCertificates(context.Context, *ListCertificatesInput, ...func(*Options)) (*ListCertificatesOutput, error) } var _ ListCertificatesAPIClient = (*Client)(nil) // ListCertificatesPaginatorOptions is the paginator options for ListCertificates type ListCertificatesPaginatorOptions struct { // The maximum number of certificates to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCertificatesPaginator is a paginator for ListCertificates type ListCertificatesPaginator struct { options ListCertificatesPaginatorOptions client ListCertificatesAPIClient params *ListCertificatesInput nextToken *string firstPage bool } // NewListCertificatesPaginator returns a new ListCertificatesPaginator func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { if params == nil { params = &ListCertificatesInput{} } options := ListCertificatesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCertificatesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCertificatesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCertificates page. func (p *ListCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesOutput, 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.ListCertificates(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_opListCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListCertificates", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the connectors for the specified Region. func (c *Client) ListConnectors(ctx context.Context, params *ListConnectorsInput, optFns ...func(*Options)) (*ListConnectorsOutput, error) { if params == nil { params = &ListConnectorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConnectors", params, optFns, c.addOperationListConnectorsMiddlewares) if err != nil { return nil, err } out := result.(*ListConnectorsOutput) out.ResultMetadata = metadata return out, nil } type ListConnectorsInput struct { // The maximum number of connectors to return. MaxResults *int32 // When you can get additional results from the ListConnectors call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional connectors. NextToken *string noSmithyDocumentSerde } type ListConnectorsOutput struct { // Returns an array, where each item contains the details of a connector. // // This member is required. Connectors []types.ListedConnector // Returns a token that you can use to call ListConnectors again and receive // additional results, if there are any. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConnectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListConnectors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListConnectors{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListConnectors(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListConnectorsAPIClient is a client that implements the ListConnectors // operation. type ListConnectorsAPIClient interface { ListConnectors(context.Context, *ListConnectorsInput, ...func(*Options)) (*ListConnectorsOutput, error) } var _ ListConnectorsAPIClient = (*Client)(nil) // ListConnectorsPaginatorOptions is the paginator options for ListConnectors type ListConnectorsPaginatorOptions struct { // The maximum number of connectors to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListConnectorsPaginator is a paginator for ListConnectors type ListConnectorsPaginator struct { options ListConnectorsPaginatorOptions client ListConnectorsAPIClient params *ListConnectorsInput nextToken *string firstPage bool } // NewListConnectorsPaginator returns a new ListConnectorsPaginator func NewListConnectorsPaginator(client ListConnectorsAPIClient, params *ListConnectorsInput, optFns ...func(*ListConnectorsPaginatorOptions)) *ListConnectorsPaginator { if params == nil { params = &ListConnectorsInput{} } options := ListConnectorsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListConnectorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListConnectorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListConnectors page. func (p *ListConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectorsOutput, 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.ListConnectors(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_opListConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListConnectors", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all in-progress executions for the specified workflow. If the specified // workflow ID cannot be found, ListExecutions returns a ResourceNotFound // exception. func (c *Client) ListExecutions(ctx context.Context, params *ListExecutionsInput, optFns ...func(*Options)) (*ListExecutionsOutput, error) { if params == nil { params = &ListExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListExecutions", params, optFns, c.addOperationListExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*ListExecutionsOutput) out.ResultMetadata = metadata return out, nil } type ListExecutionsInput struct { // A unique identifier for the workflow. // // This member is required. WorkflowId *string // Specifies the maximum number of executions to return. MaxResults *int32 // ListExecutions returns the NextToken parameter in the output. You can then pass // the NextToken parameter in a subsequent command to continue listing additional // executions. This is useful for pagination, for instance. If you have 100 // executions for a workflow, you might only want to list first 10. If so, call the // API by specifying the max-results : aws transfer list-executions --max-results // 10 This returns details for the first 10 executions, as well as the pointer ( // NextToken ) to the eleventh execution. You can now call the API again, supplying // the NextToken value you received: aws transfer list-executions --max-results 10 // --next-token $somePointerReturnedFromPreviousListResult This call returns the // next 10 executions, the 11th through the 20th. You can then repeat the call // until the details for all 100 executions have been returned. NextToken *string noSmithyDocumentSerde } type ListExecutionsOutput struct { // Returns the details for each execution, in a ListedExecution array. // // This member is required. Executions []types.ListedExecution // A unique identifier for the workflow. // // This member is required. WorkflowId *string // ListExecutions returns the NextToken parameter in the output. You can then pass // the NextToken parameter in a subsequent command to continue listing additional // executions. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListExecutions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExecutions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListExecutionsAPIClient is a client that implements the ListExecutions // operation. type ListExecutionsAPIClient interface { ListExecutions(context.Context, *ListExecutionsInput, ...func(*Options)) (*ListExecutionsOutput, error) } var _ ListExecutionsAPIClient = (*Client)(nil) // ListExecutionsPaginatorOptions is the paginator options for ListExecutions type ListExecutionsPaginatorOptions struct { // Specifies the maximum number of executions to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListExecutionsPaginator is a paginator for ListExecutions type ListExecutionsPaginator struct { options ListExecutionsPaginatorOptions client ListExecutionsAPIClient params *ListExecutionsInput nextToken *string firstPage bool } // NewListExecutionsPaginator returns a new ListExecutionsPaginator func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator { if params == nil { params = &ListExecutionsInput{} } options := ListExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListExecutions page. func (p *ListExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExecutionsOutput, 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.ListExecutions(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_opListExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListExecutions", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of host keys for the server that's specified by the ServerId // parameter. func (c *Client) ListHostKeys(ctx context.Context, params *ListHostKeysInput, optFns ...func(*Options)) (*ListHostKeysOutput, error) { if params == nil { params = &ListHostKeysInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHostKeys", params, optFns, c.addOperationListHostKeysMiddlewares) if err != nil { return nil, err } out := result.(*ListHostKeysOutput) out.ResultMetadata = metadata return out, nil } type ListHostKeysInput struct { // The identifier of the server that contains the host keys that you want to view. // // This member is required. ServerId *string // The maximum number of host keys to return. MaxResults *int32 // When there are additional results that were not returned, a NextToken parameter // is returned. You can use that value for a subsequent call to ListHostKeys to // continue listing results. NextToken *string noSmithyDocumentSerde } type ListHostKeysOutput struct { // Returns an array, where each item contains the details of a host key. // // This member is required. HostKeys []types.ListedHostKey // Returns the server identifier that contains the listed host keys. // // This member is required. ServerId *string // Returns a token that you can use to call ListHostKeys again and receive // additional results, if there are any. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListHostKeysMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHostKeys{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHostKeys{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListHostKeysValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHostKeys(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opListHostKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListHostKeys", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the profiles for your system. If you want to limit the // results to a certain number, supply a value for the MaxResults parameter. If // you ran the command previously and received a value for NextToken , you can // supply that value to continue listing profiles from where you left off. func (c *Client) ListProfiles(ctx context.Context, params *ListProfilesInput, optFns ...func(*Options)) (*ListProfilesOutput, error) { if params == nil { params = &ListProfilesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProfiles", params, optFns, c.addOperationListProfilesMiddlewares) if err != nil { return nil, err } out := result.(*ListProfilesOutput) out.ResultMetadata = metadata return out, nil } type ListProfilesInput struct { // The maximum number of profiles to return. MaxResults *int32 // When there are additional results that were not returned, a NextToken parameter // is returned. You can use that value for a subsequent call to ListProfiles to // continue listing results. NextToken *string // Indicates whether to list only LOCAL type profiles or only PARTNER type // profiles. If not supplied in the request, the command lists all types of // profiles. ProfileType types.ProfileType noSmithyDocumentSerde } type ListProfilesOutput struct { // Returns an array, where each item contains the details of a profile. // // This member is required. Profiles []types.ListedProfile // Returns a token that you can use to call ListProfiles again and receive // additional results, if there are any. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListProfiles{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListProfiles{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListProfiles(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListProfilesAPIClient is a client that implements the ListProfiles operation. type ListProfilesAPIClient interface { ListProfiles(context.Context, *ListProfilesInput, ...func(*Options)) (*ListProfilesOutput, error) } var _ ListProfilesAPIClient = (*Client)(nil) // ListProfilesPaginatorOptions is the paginator options for ListProfiles type ListProfilesPaginatorOptions struct { // The maximum number of profiles to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListProfilesPaginator is a paginator for ListProfiles type ListProfilesPaginator struct { options ListProfilesPaginatorOptions client ListProfilesAPIClient params *ListProfilesInput nextToken *string firstPage bool } // NewListProfilesPaginator returns a new ListProfilesPaginator func NewListProfilesPaginator(client ListProfilesAPIClient, params *ListProfilesInput, optFns ...func(*ListProfilesPaginatorOptions)) *ListProfilesPaginator { if params == nil { params = &ListProfilesInput{} } options := ListProfilesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListProfilesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProfilesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProfiles page. func (p *ListProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfilesOutput, 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.ListProfiles(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_opListProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListProfiles", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the security policies that are attached to your file transfer // protocol-enabled servers. func (c *Client) ListSecurityPolicies(ctx context.Context, params *ListSecurityPoliciesInput, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, error) { if params == nil { params = &ListSecurityPoliciesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSecurityPolicies", params, optFns, c.addOperationListSecurityPoliciesMiddlewares) if err != nil { return nil, err } out := result.(*ListSecurityPoliciesOutput) out.ResultMetadata = metadata return out, nil } type ListSecurityPoliciesInput struct { // Specifies the number of security policies to return as a response to the // ListSecurityPolicies query. MaxResults *int32 // When additional results are obtained from the ListSecurityPolicies command, a // NextToken parameter is returned in the output. You can then pass the NextToken // parameter in a subsequent command to continue listing additional security // policies. NextToken *string noSmithyDocumentSerde } type ListSecurityPoliciesOutput struct { // An array of security policies that were listed. // // This member is required. SecurityPolicyNames []string // When you can get additional results from the ListSecurityPolicies operation, a // NextToken parameter is returned in the output. In a following command, you can // pass in the NextToken parameter to continue listing security policies. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSecurityPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecurityPolicies{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSecurityPolicies{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSecurityPolicies(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSecurityPoliciesAPIClient is a client that implements the // ListSecurityPolicies operation. type ListSecurityPoliciesAPIClient interface { ListSecurityPolicies(context.Context, *ListSecurityPoliciesInput, ...func(*Options)) (*ListSecurityPoliciesOutput, error) } var _ ListSecurityPoliciesAPIClient = (*Client)(nil) // ListSecurityPoliciesPaginatorOptions is the paginator options for // ListSecurityPolicies type ListSecurityPoliciesPaginatorOptions struct { // Specifies the number of security policies to return as a response to the // ListSecurityPolicies query. 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 } // ListSecurityPoliciesPaginator is a paginator for ListSecurityPolicies type ListSecurityPoliciesPaginator struct { options ListSecurityPoliciesPaginatorOptions client ListSecurityPoliciesAPIClient params *ListSecurityPoliciesInput nextToken *string firstPage bool } // NewListSecurityPoliciesPaginator returns a new ListSecurityPoliciesPaginator func NewListSecurityPoliciesPaginator(client ListSecurityPoliciesAPIClient, params *ListSecurityPoliciesInput, optFns ...func(*ListSecurityPoliciesPaginatorOptions)) *ListSecurityPoliciesPaginator { if params == nil { params = &ListSecurityPoliciesInput{} } options := ListSecurityPoliciesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSecurityPoliciesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSecurityPoliciesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSecurityPolicies page. func (p *ListSecurityPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, 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.ListSecurityPolicies(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_opListSecurityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListSecurityPolicies", } }
227
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the file transfer protocol-enabled servers that are associated with your // Amazon Web Services account. func (c *Client) ListServers(ctx context.Context, params *ListServersInput, optFns ...func(*Options)) (*ListServersOutput, error) { if params == nil { params = &ListServersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListServers", params, optFns, c.addOperationListServersMiddlewares) if err != nil { return nil, err } out := result.(*ListServersOutput) out.ResultMetadata = metadata return out, nil } type ListServersInput struct { // Specifies the number of servers to return as a response to the ListServers // query. MaxResults *int32 // When additional results are obtained from the ListServers command, a NextToken // parameter is returned in the output. You can then pass the NextToken parameter // in a subsequent command to continue listing additional servers. NextToken *string noSmithyDocumentSerde } type ListServersOutput struct { // An array of servers that were listed. // // This member is required. Servers []types.ListedServer // When you can get additional results from the ListServers operation, a NextToken // parameter is returned in the output. In a following command, you can pass in the // NextToken parameter to continue listing additional servers. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListServersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListServers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListServers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListServers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListServersAPIClient is a client that implements the ListServers operation. type ListServersAPIClient interface { ListServers(context.Context, *ListServersInput, ...func(*Options)) (*ListServersOutput, error) } var _ ListServersAPIClient = (*Client)(nil) // ListServersPaginatorOptions is the paginator options for ListServers type ListServersPaginatorOptions struct { // Specifies the number of servers to return as a response to the ListServers // query. 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 } // ListServersPaginator is a paginator for ListServers type ListServersPaginator struct { options ListServersPaginatorOptions client ListServersAPIClient params *ListServersInput nextToken *string firstPage bool } // NewListServersPaginator returns a new ListServersPaginator func NewListServersPaginator(client ListServersAPIClient, params *ListServersInput, optFns ...func(*ListServersPaginatorOptions)) *ListServersPaginator { if params == nil { params = &ListServersInput{} } options := ListServersPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListServersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListServersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListServers page. func (p *ListServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServersOutput, 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.ListServers(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_opListServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListServers", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all of the tags associated with the Amazon Resource Name (ARN) that you // specify. The resource can be a user, server, or role. 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 { // Requests the tags associated with a particular Amazon Resource Name (ARN). An // ARN is an identifier for a specific Amazon Web Services resource, such as a // server, user, or role. // // This member is required. Arn *string // Specifies the number of tags to return as a response to the ListTagsForResource // request. MaxResults *int32 // When you request additional results from the ListTagsForResource operation, a // NextToken parameter is returned in the input. You can then pass in a subsequent // command to the NextToken parameter to continue listing additional tags. NextToken *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The ARN you specified to list the tags of. Arn *string // When you can get additional results from the ListTagsForResource call, a // NextToken parameter is returned in the output. You can then pass in a subsequent // command to the NextToken parameter to continue listing additional tags. NextToken *string // Key-value pairs that are assigned to a resource, usually for the purpose of // grouping and searching for items. Tags are metadata that you define. 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 { // Specifies the number of tags to return as a response to the ListTagsForResource // request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // 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{} if params.MaxResults != nil { options.Limit = *params.MaxResults } 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 var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit 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: "transfer", OperationName: "ListTagsForResource", } }
239
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the users for a file transfer protocol-enabled server that you specify by // passing the ServerId parameter. func (c *Client) ListUsers(ctx context.Context, params *ListUsersInput, optFns ...func(*Options)) (*ListUsersOutput, error) { if params == nil { params = &ListUsersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListUsers", params, optFns, c.addOperationListUsersMiddlewares) if err != nil { return nil, err } out := result.(*ListUsersOutput) out.ResultMetadata = metadata return out, nil } type ListUsersInput struct { // A system-assigned unique identifier for a server that has users assigned to it. // // This member is required. ServerId *string // Specifies the number of users to return as a response to the ListUsers request. MaxResults *int32 // When you can get additional results from the ListUsers call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional users. NextToken *string noSmithyDocumentSerde } type ListUsersOutput struct { // A system-assigned unique identifier for a server that the users are assigned to. // // This member is required. ServerId *string // Returns the Transfer Family users and their properties for the ServerId value // that you specify. // // This member is required. Users []types.ListedUser // When you can get additional results from the ListUsers call, a NextToken // parameter is returned in the output. You can then pass in a subsequent command // to the NextToken parameter to continue listing additional users. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListUsers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListUsers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListUsersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUsers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListUsersAPIClient is a client that implements the ListUsers operation. type ListUsersAPIClient interface { ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) } var _ ListUsersAPIClient = (*Client)(nil) // ListUsersPaginatorOptions is the paginator options for ListUsers type ListUsersPaginatorOptions struct { // Specifies the number of users to return as a response to the ListUsers request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListUsersPaginator is a paginator for ListUsers type ListUsersPaginator struct { options ListUsersPaginatorOptions client ListUsersAPIClient params *ListUsersInput nextToken *string firstPage bool } // NewListUsersPaginator returns a new ListUsersPaginator func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { if params == nil { params = &ListUsersInput{} } options := ListUsersPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListUsersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListUsersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListUsers page. func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, 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.ListUsers(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_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListUsers", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all workflows associated with your Amazon Web Services account for your // current region. func (c *Client) ListWorkflows(ctx context.Context, params *ListWorkflowsInput, optFns ...func(*Options)) (*ListWorkflowsOutput, error) { if params == nil { params = &ListWorkflowsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorkflows", params, optFns, c.addOperationListWorkflowsMiddlewares) if err != nil { return nil, err } out := result.(*ListWorkflowsOutput) out.ResultMetadata = metadata return out, nil } type ListWorkflowsInput struct { // Specifies the maximum number of workflows to return. MaxResults *int32 // ListWorkflows returns the NextToken parameter in the output. You can then pass // the NextToken parameter in a subsequent command to continue listing additional // workflows. NextToken *string noSmithyDocumentSerde } type ListWorkflowsOutput struct { // Returns the Arn , WorkflowId , and Description for each workflow. // // This member is required. Workflows []types.ListedWorkflow // ListWorkflows returns the NextToken parameter in the output. You can then pass // the NextToken parameter in a subsequent command to continue listing additional // workflows. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorkflowsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListWorkflows{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListWorkflows{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorkflows(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListWorkflowsAPIClient is a client that implements the ListWorkflows operation. type ListWorkflowsAPIClient interface { ListWorkflows(context.Context, *ListWorkflowsInput, ...func(*Options)) (*ListWorkflowsOutput, error) } var _ ListWorkflowsAPIClient = (*Client)(nil) // ListWorkflowsPaginatorOptions is the paginator options for ListWorkflows type ListWorkflowsPaginatorOptions struct { // Specifies the maximum number of workflows to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListWorkflowsPaginator is a paginator for ListWorkflows type ListWorkflowsPaginator struct { options ListWorkflowsPaginatorOptions client ListWorkflowsAPIClient params *ListWorkflowsInput nextToken *string firstPage bool } // NewListWorkflowsPaginator returns a new ListWorkflowsPaginator func NewListWorkflowsPaginator(client ListWorkflowsAPIClient, params *ListWorkflowsInput, optFns ...func(*ListWorkflowsPaginatorOptions)) *ListWorkflowsPaginator { if params == nil { params = &ListWorkflowsInput{} } options := ListWorkflowsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorkflowsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorkflowsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorkflows page. func (p *ListWorkflowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowsOutput, 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.ListWorkflows(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_opListWorkflows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "ListWorkflows", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Sends a callback for asynchronous custom steps. The ExecutionId , WorkflowId , // and Token are passed to the target resource during execution of a custom step // of a workflow. You must include those with their callback as well as providing a // status. func (c *Client) SendWorkflowStepState(ctx context.Context, params *SendWorkflowStepStateInput, optFns ...func(*Options)) (*SendWorkflowStepStateOutput, error) { if params == nil { params = &SendWorkflowStepStateInput{} } result, metadata, err := c.invokeOperation(ctx, "SendWorkflowStepState", params, optFns, c.addOperationSendWorkflowStepStateMiddlewares) if err != nil { return nil, err } out := result.(*SendWorkflowStepStateOutput) out.ResultMetadata = metadata return out, nil } type SendWorkflowStepStateInput struct { // A unique identifier for the execution of a workflow. // // This member is required. ExecutionId *string // Indicates whether the specified step succeeded or failed. // // This member is required. Status types.CustomStepStatus // Used to distinguish between multiple callbacks for multiple Lambda steps within // the same execution. // // This member is required. Token *string // A unique identifier for the workflow. // // This member is required. WorkflowId *string noSmithyDocumentSerde } type SendWorkflowStepStateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSendWorkflowStepStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpSendWorkflowStepState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSendWorkflowStepState{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpSendWorkflowStepStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendWorkflowStepState(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opSendWorkflowStepState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "SendWorkflowStepState", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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" ) // Begins an outbound file transfer to a remote AS2 server. You specify the // ConnectorId and the file paths for where to send the files. func (c *Client) StartFileTransfer(ctx context.Context, params *StartFileTransferInput, optFns ...func(*Options)) (*StartFileTransferOutput, error) { if params == nil { params = &StartFileTransferInput{} } result, metadata, err := c.invokeOperation(ctx, "StartFileTransfer", params, optFns, c.addOperationStartFileTransferMiddlewares) if err != nil { return nil, err } out := result.(*StartFileTransferOutput) out.ResultMetadata = metadata return out, nil } type StartFileTransferInput struct { // The unique identifier for the connector. // // This member is required. ConnectorId *string // An array of strings. Each string represents the absolute path for one outbound // file transfer. For example, DOC-EXAMPLE-BUCKET/myfile.txt . // // This member is required. SendFilePaths []string noSmithyDocumentSerde } type StartFileTransferOutput struct { // Returns the unique identifier for this file transfer. // // This member is required. TransferId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartFileTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartFileTransfer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartFileTransfer{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartFileTransferValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartFileTransfer(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartFileTransfer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "StartFileTransfer", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Changes the state of a file transfer protocol-enabled server from OFFLINE to // ONLINE . It has no impact on a server that is already ONLINE . An ONLINE server // can accept and process file transfer jobs. The state of STARTING indicates that // the server is in an intermediate state, either not fully able to respond, or not // fully online. The values of START_FAILED can indicate an error condition. No // response is returned from this call. func (c *Client) StartServer(ctx context.Context, params *StartServerInput, optFns ...func(*Options)) (*StartServerOutput, error) { if params == nil { params = &StartServerInput{} } result, metadata, err := c.invokeOperation(ctx, "StartServer", params, optFns, c.addOperationStartServerMiddlewares) if err != nil { return nil, err } out := result.(*StartServerOutput) out.ResultMetadata = metadata return out, nil } type StartServerInput struct { // A system-assigned unique identifier for a server that you start. // // This member is required. ServerId *string noSmithyDocumentSerde } type StartServerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartServerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartServer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartServer{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartServerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartServer(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartServer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "StartServer", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Changes the state of a file transfer protocol-enabled server from ONLINE to // OFFLINE . An OFFLINE server cannot accept and process file transfer jobs. // Information tied to your server, such as server and user properties, are not // affected by stopping your server. Stopping the server does not reduce or impact // your file transfer protocol endpoint billing; you must delete the server to stop // being billed. The state of STOPPING indicates that the server is in an // intermediate state, either not fully able to respond, or not fully offline. The // values of STOP_FAILED can indicate an error condition. No response is returned // from this call. func (c *Client) StopServer(ctx context.Context, params *StopServerInput, optFns ...func(*Options)) (*StopServerOutput, error) { if params == nil { params = &StopServerInput{} } result, metadata, err := c.invokeOperation(ctx, "StopServer", params, optFns, c.addOperationStopServerMiddlewares) if err != nil { return nil, err } out := result.(*StopServerOutput) out.ResultMetadata = metadata return out, nil } type StopServerInput struct { // A system-assigned unique identifier for a server that you stopped. // // This member is required. ServerId *string noSmithyDocumentSerde } type StopServerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopServerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopServer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopServer{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopServerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopServer(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopServer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "StopServer", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches a key-value pair to a resource, as identified by its Amazon Resource // Name (ARN). Resources are users, servers, roles, and other entities. There is no // response returned from this call. 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 { // An Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such // as a server, user, or role. // // This member is required. Arn *string // Key-value pairs assigned to ARNs that you can use to group and search for // resources by type. You can attach this metadata to resources (servers, users, // workflows, and so on) for any purpose. // // 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: "transfer", OperationName: "TagResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // If the IdentityProviderType of a file transfer protocol-enabled server is // AWS_DIRECTORY_SERVICE or API_Gateway , tests whether your identity provider is // set up successfully. We highly recommend that you call this operation to test // your authentication method as soon as you create your server. By doing so, you // can troubleshoot issues with the identity provider integration to ensure that // your users can successfully use the service. The ServerId and UserName // parameters are required. The ServerProtocol , SourceIp , and UserPassword are // all optional. Note the following: // // - You cannot use TestIdentityProvider if the IdentityProviderType of your // server is SERVICE_MANAGED . // // - TestIdentityProvider does not work with keys: it only accepts passwords. // // - TestIdentityProvider can test the password operation for a custom Identity // Provider that handles keys and passwords. // // - If you provide any incorrect values for any parameters, the Response field // is empty. // // - If you provide a server ID for a server that uses service-managed users, // you get an error: An error occurred (InvalidRequestException) when calling // the TestIdentityProvider operation: s-server-ID not configured for external auth // // - If you enter a Server ID for the --server-id parameter that does not // identify an actual Transfer server, you receive the following error: An error // occurred (ResourceNotFoundException) when calling the TestIdentityProvider // operation: Unknown server . It is possible your sever is in a different // region. You can specify a region by adding the following: --region region-code // , such as --region us-east-2 to specify a server in US East (Ohio). func (c *Client) TestIdentityProvider(ctx context.Context, params *TestIdentityProviderInput, optFns ...func(*Options)) (*TestIdentityProviderOutput, error) { if params == nil { params = &TestIdentityProviderInput{} } result, metadata, err := c.invokeOperation(ctx, "TestIdentityProvider", params, optFns, c.addOperationTestIdentityProviderMiddlewares) if err != nil { return nil, err } out := result.(*TestIdentityProviderOutput) out.ResultMetadata = metadata return out, nil } type TestIdentityProviderInput struct { // A system-assigned identifier for a specific server. That server's user // authentication method is tested with a user name and password. // // This member is required. ServerId *string // The name of the account to be tested. // // This member is required. UserName *string // The type of file transfer protocol to be tested. The available protocols are: // - Secure Shell (SSH) File Transfer Protocol (SFTP) // - File Transfer Protocol Secure (FTPS) // - File Transfer Protocol (FTP) // - Applicability Statement 2 (AS2) ServerProtocol types.Protocol // The source IP address of the account to be tested. SourceIp *string // The password of the account to be tested. UserPassword *string noSmithyDocumentSerde } type TestIdentityProviderOutput struct { // The HTTP status code that is the response from your API Gateway or your Lambda // function. // // This member is required. StatusCode int32 // The endpoint of the service used to authenticate a user. // // This member is required. Url *string // A message that indicates whether the test was successful or not. If an empty // string is returned, the most likely cause is that the authentication failed due // to an incorrect username or password. Message *string // The response that is returned from your API Gateway or your Lambda function. Response *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTestIdentityProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTestIdentityProvider{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTestIdentityProvider{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTestIdentityProviderValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestIdentityProvider(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTestIdentityProvider(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "TestIdentityProvider", } }
189
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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 key-value pair from a resource, as identified by its Amazon Resource // Name (ARN). Resources are users, servers, roles, and other entities. No response // is returned from this call. 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 value of the resource that will have the tag removed. An Amazon Resource // Name (ARN) is an identifier for a specific Amazon Web Services resource, such as // a server, user, or role. // // This member is required. Arn *string // TagKeys are key-value pairs assigned to ARNs that can be used to group and // search for resources by type. This metadata can be attached to resources for any // purpose. // // 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: "transfer", OperationName: "UntagResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows you to update parameters for the access specified in the ServerID and // ExternalID parameters. func (c *Client) UpdateAccess(ctx context.Context, params *UpdateAccessInput, optFns ...func(*Options)) (*UpdateAccessOutput, error) { if params == nil { params = &UpdateAccessInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAccess", params, optFns, c.addOperationUpdateAccessMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAccessOutput) out.ResultMetadata = metadata return out, nil } type UpdateAccessInput struct { // A unique identifier that is required to identify specific groups within your // directory. The users of the group that you associate have access to your Amazon // S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If // you know the group name, you can view the SID values by running the following // command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like // "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that // command, replace YourGroupName with the name of your Active Directory group. The // regular expression used to validate this parameter is a string of characters // consisting of uppercase and lowercase alphanumeric characters with no spaces. // You can also include underscores or any of the following characters: =,.@:/- // // This member is required. ExternalId *string // A system-assigned unique identifier for a server instance. This is the specific // server that you added your user to. // // This member is required. ServerId *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and // keys should be visible to your user and how you want to make them visible. You // must specify the Entry and Target pair, where Entry shows how the path is made // visible and Target is the actual Amazon S3 or Amazon EFS path. If you only // specify a target, it is displayed as is. You also must ensure that your Identity // and Access Management (IAM) role provides access to paths in Target . This value // can be set only when HomeDirectoryType is set to LOGICAL. The following is an // Entry and Target pair example. [ { "Entry": "/directory1", "Target": // "/bucket_name/home/mydirectory" } ] In most cases, you can use this value // instead of the session policy to lock down your user to the designated home // directory (" chroot "). To do this, you can set Entry to / and set Target to // the HomeDirectory parameter value. The following is an Entry and Target pair // example for chroot . [ { "Entry": "/", "Target": // "/bucket_name/home/mydirectory" } ] HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access // Management (IAM) role across multiple users. This policy scopes down a user's // access to portions of their Amazon S3 bucket. Variables that you can use inside // this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and // ${Transfer:HomeBucket} . This policy applies only when the domain of ServerId // is Amazon S3. Amazon EFS does not use session policies. For session policies, // Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource // Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the // Policy argument. For an example of a session policy, see Example session policy (https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html) // . For more information, see AssumeRole (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) // in the Amazon Web ServicesSecurity Token Service API Reference. Policy *string // The full POSIX identity, including user ID ( Uid ), group ID ( Gid ), and any // secondary groups IDs ( SecondaryGids ), that controls your users' access to your // Amazon EFS file systems. The POSIX permissions that are set on files and // directories in your file system determine the level of access your users get // when transferring files into and out of your Amazon EFS file systems. PosixProfile *types.PosixProfile // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. Role *string noSmithyDocumentSerde } type UpdateAccessOutput struct { // The external identifier of the group whose users have access to your Amazon S3 // or Amazon EFS resources over the enabled protocols using Amazon Web // ServicesTransfer Family. // // This member is required. ExternalId *string // The identifier of the server that the user is attached to. // // This member is required. ServerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAccess{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAccess{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateAccessValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccess(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateAccess", } }
207
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates some of the parameters for an existing agreement. Provide the // AgreementId and the ServerId for the agreement that you want to update, along // with the new values for the parameters to update. func (c *Client) UpdateAgreement(ctx context.Context, params *UpdateAgreementInput, optFns ...func(*Options)) (*UpdateAgreementOutput, error) { if params == nil { params = &UpdateAgreementInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAgreement", params, optFns, c.addOperationUpdateAgreementMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAgreementOutput) out.ResultMetadata = metadata return out, nil } type UpdateAgreementInput struct { // A unique identifier for the agreement. This identifier is returned when you // create an agreement. // // This member is required. AgreementId *string // A system-assigned unique identifier for a server instance. This is the specific // server that the agreement uses. // // This member is required. ServerId *string // With AS2, you can send files by calling StartFileTransfer and specifying the // file paths in the request parameter, SendFilePaths . We use the file’s parent // directory (for example, for --send-file-paths /bucket/dir/file.txt , parent // directory is /bucket/dir/ ) to temporarily store a processed AS2 message file, // store the MDN when we receive them from the partner, and write a final JSON file // containing relevant metadata of the transmission. So, the AccessRole needs to // provide read and write access to the parent directory of the file location used // in the StartFileTransfer request. Additionally, you need to provide read and // write access to the parent directory of the files that you intend to send with // StartFileTransfer . If you are using Basic authentication for your AS2 // connector, the access role requires the secretsmanager:GetSecretValue // permission for the secret. If the secret is encrypted using a customer-managed // key instead of the Amazon Web Services managed key in Secrets Manager, then the // role also needs the kms:Decrypt permission for that key. AccessRole *string // To change the landing directory (folder) for files that are transferred, // provide the bucket folder that you want to use; for example, // /DOC-EXAMPLE-BUCKET/home/mydirectory . BaseDirectory *string // To replace the existing description, provide a short description for the // agreement. Description *string // A unique identifier for the AS2 local profile. To change the local profile // identifier, provide a new value here. LocalProfileId *string // A unique identifier for the partner profile. To change the partner profile // identifier, provide a new value here. PartnerProfileId *string // You can update the status for the agreement, either activating an inactive // agreement or the reverse. Status types.AgreementStatusType noSmithyDocumentSerde } type UpdateAgreementOutput struct { // A unique identifier for the agreement. This identifier is returned when you // create an agreement. // // This member is required. AgreementId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAgreementMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAgreement{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAgreement{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateAgreementValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAgreement(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateAgreement(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateAgreement", } }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates the active and inactive dates for a certificate. func (c *Client) UpdateCertificate(ctx context.Context, params *UpdateCertificateInput, optFns ...func(*Options)) (*UpdateCertificateOutput, error) { if params == nil { params = &UpdateCertificateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateCertificate", params, optFns, c.addOperationUpdateCertificateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateCertificateOutput) out.ResultMetadata = metadata return out, nil } type UpdateCertificateInput struct { // The identifier of the certificate object that you are updating. // // This member is required. CertificateId *string // An optional date that specifies when the certificate becomes active. ActiveDate *time.Time // A short description to help identify the certificate. Description *string // An optional date that specifies when the certificate becomes inactive. InactiveDate *time.Time noSmithyDocumentSerde } type UpdateCertificateOutput struct { // Returns the identifier of the certificate object that you are updating. // // This member is required. CertificateId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateCertificate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateCertificate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateCertificateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCertificate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateCertificate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateCertificate", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates some of the parameters for an existing connector. Provide the // ConnectorId for the connector that you want to update, along with the new values // for the parameters to update. func (c *Client) UpdateConnector(ctx context.Context, params *UpdateConnectorInput, optFns ...func(*Options)) (*UpdateConnectorOutput, error) { if params == nil { params = &UpdateConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateConnector", params, optFns, c.addOperationUpdateConnectorMiddlewares) if err != nil { return nil, err } out := result.(*UpdateConnectorOutput) out.ResultMetadata = metadata return out, nil } type UpdateConnectorInput struct { // The unique identifier for the connector. // // This member is required. ConnectorId *string // With AS2, you can send files by calling StartFileTransfer and specifying the // file paths in the request parameter, SendFilePaths . We use the file’s parent // directory (for example, for --send-file-paths /bucket/dir/file.txt , parent // directory is /bucket/dir/ ) to temporarily store a processed AS2 message file, // store the MDN when we receive them from the partner, and write a final JSON file // containing relevant metadata of the transmission. So, the AccessRole needs to // provide read and write access to the parent directory of the file location used // in the StartFileTransfer request. Additionally, you need to provide read and // write access to the parent directory of the files that you intend to send with // StartFileTransfer . If you are using Basic authentication for your AS2 // connector, the access role requires the secretsmanager:GetSecretValue // permission for the secret. If the secret is encrypted using a customer-managed // key instead of the Amazon Web Services managed key in Secrets Manager, then the // role also needs the kms:Decrypt permission for that key. AccessRole *string // A structure that contains the parameters for a connector object. As2Config *types.As2ConnectorConfig // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a connector to turn on CloudWatch logging for Amazon S3 events. When // set, you can view connector activity in your CloudWatch logs. LoggingRole *string // The URL of the partner's AS2 endpoint. Url *string noSmithyDocumentSerde } type UpdateConnectorOutput struct { // Returns the identifier of the connector object that you are updating. // // This member is required. ConnectorId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateConnector{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConnector(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateConnector", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the description for the host key that's specified by the ServerId and // HostKeyId parameters. func (c *Client) UpdateHostKey(ctx context.Context, params *UpdateHostKeyInput, optFns ...func(*Options)) (*UpdateHostKeyOutput, error) { if params == nil { params = &UpdateHostKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateHostKey", params, optFns, c.addOperationUpdateHostKeyMiddlewares) if err != nil { return nil, err } out := result.(*UpdateHostKeyOutput) out.ResultMetadata = metadata return out, nil } type UpdateHostKeyInput struct { // An updated description for the host key. // // This member is required. Description *string // The identifier of the host key that you are updating. // // This member is required. HostKeyId *string // The identifier of the server that contains the host key that you are updating. // // This member is required. ServerId *string noSmithyDocumentSerde } type UpdateHostKeyOutput struct { // Returns the host key identifier for the updated host key. // // This member is required. HostKeyId *string // Returns the server identifier for the server that contains the updated host key. // // This member is required. ServerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateHostKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateHostKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateHostKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateHostKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateHostKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateHostKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateHostKey", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates some of the parameters for an existing profile. Provide the ProfileId // for the profile that you want to update, along with the new values for the // parameters to update. func (c *Client) UpdateProfile(ctx context.Context, params *UpdateProfileInput, optFns ...func(*Options)) (*UpdateProfileOutput, error) { if params == nil { params = &UpdateProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateProfile", params, optFns, c.addOperationUpdateProfileMiddlewares) if err != nil { return nil, err } out := result.(*UpdateProfileOutput) out.ResultMetadata = metadata return out, nil } type UpdateProfileInput struct { // The identifier of the profile object that you are updating. // // This member is required. ProfileId *string // An array of identifiers for the imported certificates. You use this identifier // for working with profiles and partner profiles. CertificateIds []string noSmithyDocumentSerde } type UpdateProfileOutput struct { // Returns the identifier for the profile that's being updated. // // This member is required. ProfileId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateProfile", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the file transfer protocol-enabled server's properties after that // server has been created. The UpdateServer call returns the ServerId of the // server you updated. func (c *Client) UpdateServer(ctx context.Context, params *UpdateServerInput, optFns ...func(*Options)) (*UpdateServerOutput, error) { if params == nil { params = &UpdateServerInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateServer", params, optFns, c.addOperationUpdateServerMiddlewares) if err != nil { return nil, err } out := result.(*UpdateServerOutput) out.ResultMetadata = metadata return out, nil } type UpdateServerInput struct { // A system-assigned unique identifier for a server instance that the Transfer // Family user is assigned to. // // This member is required. ServerId *string // The Amazon Resource Name (ARN) of the Amazon Web ServicesCertificate Manager // (ACM) certificate. Required when Protocols is set to FTPS . To request a new // public certificate, see Request a public certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html) // in the Amazon Web ServicesCertificate Manager User Guide. To import an existing // certificate into ACM, see Importing certificates into ACM (https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html) // in the Amazon Web ServicesCertificate Manager User Guide. To request a private // certificate to use FTPS through private IP addresses, see Request a private // certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html) // in the Amazon Web ServicesCertificate Manager User Guide. Certificates with the // following cryptographic algorithms and key sizes are supported: // - 2048-bit RSA (RSA_2048) // - 4096-bit RSA (RSA_4096) // - Elliptic Prime Curve 256 bit (EC_prime256v1) // - Elliptic Prime Curve 384 bit (EC_secp384r1) // - Elliptic Prime Curve 521 bit (EC_secp521r1) // The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN // or IP address specified and information about the issuer. Certificate *string // The virtual private cloud (VPC) endpoint settings that are configured for your // server. When you host your endpoint within your VPC, you can make your endpoint // accessible only to resources within your VPC, or you can attach Elastic IP // addresses and make your endpoint accessible to clients over the internet. Your // VPC's default security groups are automatically assigned to your endpoint. EndpointDetails *types.EndpointDetails // The type of endpoint that you want your server to use. You can choose to make // your server's endpoint publicly accessible (PUBLIC) or host it inside your VPC. // With an endpoint that is hosted in a VPC, you can restrict access to your server // and resources only within your VPC or choose to make it internet facing by // attaching Elastic IP addresses directly to it. After May 19, 2021, you won't be // able to create a server using EndpointType=VPC_ENDPOINT in your Amazon Web // Servicesaccount if your account hasn't already done so before May 19, 2021. If // you have already created servers with EndpointType=VPC_ENDPOINT in your Amazon // Web Servicesaccount on or before May 19, 2021, you will not be affected. After // this date, use EndpointType = VPC . For more information, see // https://docs.aws.amazon.com/transfer/latest/userguide/create-server-in-vpc.html#deprecate-vpc-endpoint. // It is recommended that you use VPC as the EndpointType . With this endpoint // type, you have the option to directly associate up to three Elastic IPv4 // addresses (BYO IP included) with your server's endpoint and use VPC security // groups to restrict traffic by the client's public IP address. This is not // possible with EndpointType set to VPC_ENDPOINT . EndpointType types.EndpointType // The RSA, ECDSA, or ED25519 private key to use for your SFTP-enabled server. You // can add multiple host keys, in case you want to rotate keys, or have a set of // active keys that use different algorithms. Use the following command to generate // an RSA 2048 bit key with no passphrase: ssh-keygen -t rsa -b 2048 -N "" -m PEM // -f my-new-server-key . Use a minimum value of 2048 for the -b option. You can // create a stronger key by using 3072 or 4096. Use the following command to // generate an ECDSA 256 bit key with no passphrase: ssh-keygen -t ecdsa -b 256 -N // "" -m PEM -f my-new-server-key . Valid values for the -b option for ECDSA are // 256, 384, and 521. Use the following command to generate an ED25519 key with no // passphrase: ssh-keygen -t ed25519 -N "" -f my-new-server-key . For all of these // commands, you can replace my-new-server-key with a string of your choice. If you // aren't planning to migrate existing users from an existing SFTP-enabled server // to a new server, don't update the host key. Accidentally changing a server's // host key can be disruptive. For more information, see Manage host keys for your // SFTP-enabled server (https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key) // in the Transfer Family User Guide. HostKey *string // An array containing all of the information required to call a customer's // authentication API method. IdentityProviderDetails *types.IdentityProviderDetails // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or // Amazon EFSevents. When set, you can view user activity in your CloudWatch logs. LoggingRole *string // Specifies a string to display when users connect to a server. This string is // displayed after the user authenticates. The SFTP protocol does not support // post-authentication display banners. PostAuthenticationLoginBanner *string // Specifies a string to display when users connect to a server. This string is // displayed before the user authenticates. For example, the following banner // displays details about using the system: This system is for the use of // authorized users only. Individuals using this computer system without authority, // or in excess of their authority, are subject to having all of their activities // on this system monitored and recorded by system personnel. PreAuthenticationLoginBanner *string // The protocol settings that are configured for your server. // - To indicate passive mode (for FTP and FTPS protocols), use the PassiveIp // parameter. Enter a single dotted-quad IPv4 address, such as the external IP // address of a firewall, router, or load balancer. // - To ignore the error that is generated when the client attempts to use the // SETSTAT command on a file that you are uploading to an Amazon S3 bucket, use // the SetStatOption parameter. To have the Transfer Family server ignore the // SETSTAT command and upload files without needing to make any changes to your // SFTP client, set the value to ENABLE_NO_OP . If you set the SetStatOption // parameter to ENABLE_NO_OP , Transfer Family generates a log entry to Amazon // CloudWatch Logs, so that you can determine when the client is making a SETSTAT // call. // - To determine whether your Transfer Family server resumes recent, negotiated // sessions through a unique session ID, use the TlsSessionResumptionMode // parameter. // - As2Transports indicates the transport method for the AS2 messages. // Currently, only HTTP is supported. ProtocolDetails *types.ProtocolDetails // Specifies the file transfer protocol or protocols over which your file transfer // protocol client can connect to your server's endpoint. The available protocols // are: // - SFTP (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH // - FTPS (File Transfer Protocol Secure): File transfer with TLS encryption // - FTP (File Transfer Protocol): Unencrypted file transfer // - AS2 (Applicability Statement 2): used for transporting structured // business-to-business data // // - If you select FTPS , you must choose a certificate stored in Certificate // Manager (ACM) which is used to identify your server when clients connect to it // over FTPS. // - If Protocol includes either FTP or FTPS , then the EndpointType must be VPC // and the IdentityProviderType must be either AWS_DIRECTORY_SERVICE , AWS_LAMBDA // , or API_GATEWAY . // - If Protocol includes FTP , then AddressAllocationIds cannot be associated. // - If Protocol is set only to SFTP , the EndpointType can be set to PUBLIC and // the IdentityProviderType can be set any of the supported identity types: // SERVICE_MANAGED , AWS_DIRECTORY_SERVICE , AWS_LAMBDA , or API_GATEWAY . // - If Protocol includes AS2 , then the EndpointType must be VPC , and domain // must be Amazon S3. Protocols []types.Protocol // Specifies the name of the security policy that is attached to the server. SecurityPolicyName *string // Specifies the log groups to which your server logs are sent. To specify a log // group, you must provide the ARN for an existing log group. In this case, the // format of the log group is as follows: // arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:* For // example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:* If you // have previously specified a log group for a server, you can clear it, and in // effect turn off structured logging, by providing an empty value for this // parameter in an update-server call. For example: update-server --server-id // s-1234567890abcdef0 --structured-log-destinations StructuredLogDestinations []string // Specifies the workflow ID for the workflow to assign and the execution role // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when the server session disconnects while the file is still being // uploaded. To remove an associated workflow from a server, you can provide an // empty OnUpload object, as in the following example. aws transfer update-server // --server-id s-01234567890abcdef --workflow-details '{"OnUpload":[]}' WorkflowDetails *types.WorkflowDetails noSmithyDocumentSerde } type UpdateServerOutput struct { // A system-assigned unique identifier for a server that the Transfer Family user // is assigned to. // // This member is required. ServerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateServerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateServer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateServer{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateServerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServer(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateServer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateServer", } }
281
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Assigns new properties to a user. Parameters you pass modify any or all of the // following: the home directory, role, and policy for the UserName and ServerId // you specify. The response returns the ServerId and the UserName for the updated // user. func (c *Client) UpdateUser(ctx context.Context, params *UpdateUserInput, optFns ...func(*Options)) (*UpdateUserOutput, error) { if params == nil { params = &UpdateUserInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateUser", params, optFns, c.addOperationUpdateUserMiddlewares) if err != nil { return nil, err } out := result.(*UpdateUserOutput) out.ResultMetadata = metadata return out, nil } type UpdateUserInput struct { // A system-assigned unique identifier for a Transfer Family server instance that // the user is assigned to. // // This member is required. ServerId *string // A unique string that identifies a user and is associated with a server as // specified by the ServerId . This user name must be a minimum of 3 and a maximum // of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, // underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't // start with a hyphen, period, or at sign. // // This member is required. UserName *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and // keys should be visible to your user and how you want to make them visible. You // must specify the Entry and Target pair, where Entry shows how the path is made // visible and Target is the actual Amazon S3 or Amazon EFS path. If you only // specify a target, it is displayed as is. You also must ensure that your Identity // and Access Management (IAM) role provides access to paths in Target . This value // can be set only when HomeDirectoryType is set to LOGICAL. The following is an // Entry and Target pair example. [ { "Entry": "/directory1", "Target": // "/bucket_name/home/mydirectory" } ] In most cases, you can use this value // instead of the session policy to lock down your user to the designated home // directory (" chroot "). To do this, you can set Entry to '/' and set Target to // the HomeDirectory parameter value. The following is an Entry and Target pair // example for chroot . [ { "Entry": "/", "Target": // "/bucket_name/home/mydirectory" } ] HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType types.HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access // Management (IAM) role across multiple users. This policy scopes down a user's // access to portions of their Amazon S3 bucket. Variables that you can use inside // this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and // ${Transfer:HomeBucket} . This policy applies only when the domain of ServerId // is Amazon S3. Amazon EFS does not use session policies. For session policies, // Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource // Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the // Policy argument. For an example of a session policy, see Creating a session // policy (https://docs.aws.amazon.com/transfer/latest/userguide/session-policy) . // For more information, see AssumeRole (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) // in the Amazon Web Services Security Token Service API Reference. Policy *string // Specifies the full POSIX identity, including user ID ( Uid ), group ID ( Gid ), // and any secondary groups IDs ( SecondaryGids ), that controls your users' access // to your Amazon Elastic File Systems (Amazon EFS). The POSIX permissions that are // set on files and directories in your file system determines the level of access // your users get when transferring files into and out of your Amazon EFS file // systems. PosixProfile *types.PosixProfile // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. Role *string noSmithyDocumentSerde } // UpdateUserResponse returns the user name and identifier for the request to // update a user's properties. type UpdateUserOutput struct { // A system-assigned unique identifier for a Transfer Family server instance that // the account is assigned to. // // This member is required. ServerId *string // The unique identifier for a user that is assigned to a server instance that was // specified in the request. // // This member is required. UserName *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUser(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "transfer", OperationName: "UpdateUser", } }
208
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/transfer/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_deserializeOpCreateAccess struct { } func (*awsAwsjson11_deserializeOpCreateAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateAccess) 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_deserializeOpErrorCreateAccess(response, &metadata) } output := &CreateAccessOutput{} 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_deserializeOpDocumentCreateAccessOutput(&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_deserializeOpErrorCreateAccess(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateAgreement struct { } func (*awsAwsjson11_deserializeOpCreateAgreement) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateAgreement) 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_deserializeOpErrorCreateAgreement(response, &metadata) } output := &CreateAgreementOutput{} 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_deserializeOpDocumentCreateAgreementOutput(&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_deserializeOpErrorCreateAgreement(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateConnector struct { } func (*awsAwsjson11_deserializeOpCreateConnector) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateConnector) 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_deserializeOpErrorCreateConnector(response, &metadata) } output := &CreateConnectorOutput{} 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_deserializeOpDocumentCreateConnectorOutput(&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_deserializeOpErrorCreateConnector(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateProfile struct { } func (*awsAwsjson11_deserializeOpCreateProfile) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateProfile) 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_deserializeOpErrorCreateProfile(response, &metadata) } output := &CreateProfileOutput{} 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_deserializeOpDocumentCreateProfileOutput(&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_deserializeOpErrorCreateProfile(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateServer struct { } func (*awsAwsjson11_deserializeOpCreateServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateServer) 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_deserializeOpErrorCreateServer(response, &metadata) } output := &CreateServerOutput{} 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_deserializeOpDocumentCreateServerOutput(&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_deserializeOpErrorCreateServer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateUser struct { } func (*awsAwsjson11_deserializeOpCreateUser) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorCreateUser(response, &metadata) } output := &CreateUserOutput{} 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_deserializeOpDocumentCreateUserOutput(&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_deserializeOpErrorCreateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateWorkflow struct { } func (*awsAwsjson11_deserializeOpCreateWorkflow) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateWorkflow) 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_deserializeOpErrorCreateWorkflow(response, &metadata) } output := &CreateWorkflowOutput{} 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_deserializeOpDocumentCreateWorkflowOutput(&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_deserializeOpErrorCreateWorkflow(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteAccess struct { } func (*awsAwsjson11_deserializeOpDeleteAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteAccess) 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_deserializeOpErrorDeleteAccess(response, &metadata) } output := &DeleteAccessOutput{} 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_deserializeOpErrorDeleteAccess(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteAgreement struct { } func (*awsAwsjson11_deserializeOpDeleteAgreement) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteAgreement) 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_deserializeOpErrorDeleteAgreement(response, &metadata) } output := &DeleteAgreementOutput{} 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_deserializeOpErrorDeleteAgreement(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteCertificate struct { } func (*awsAwsjson11_deserializeOpDeleteCertificate) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteCertificate) 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_deserializeOpErrorDeleteCertificate(response, &metadata) } output := &DeleteCertificateOutput{} 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_deserializeOpErrorDeleteCertificate(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteConnector struct { } func (*awsAwsjson11_deserializeOpDeleteConnector) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteConnector) 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_deserializeOpErrorDeleteConnector(response, &metadata) } output := &DeleteConnectorOutput{} 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_deserializeOpErrorDeleteConnector(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteHostKey struct { } func (*awsAwsjson11_deserializeOpDeleteHostKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteHostKey) 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_deserializeOpErrorDeleteHostKey(response, &metadata) } output := &DeleteHostKeyOutput{} 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_deserializeOpErrorDeleteHostKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteProfile struct { } func (*awsAwsjson11_deserializeOpDeleteProfile) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteProfile) 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_deserializeOpErrorDeleteProfile(response, &metadata) } output := &DeleteProfileOutput{} 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_deserializeOpErrorDeleteProfile(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteServer struct { } func (*awsAwsjson11_deserializeOpDeleteServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteServer) 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_deserializeOpErrorDeleteServer(response, &metadata) } output := &DeleteServerOutput{} 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_deserializeOpErrorDeleteServer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteSshPublicKey struct { } func (*awsAwsjson11_deserializeOpDeleteSshPublicKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteSshPublicKey) 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_deserializeOpErrorDeleteSshPublicKey(response, &metadata) } output := &DeleteSshPublicKeyOutput{} 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_deserializeOpErrorDeleteSshPublicKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteUser struct { } func (*awsAwsjson11_deserializeOpDeleteUser) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteUser(response, &metadata) } output := &DeleteUserOutput{} 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_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteWorkflow struct { } func (*awsAwsjson11_deserializeOpDeleteWorkflow) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteWorkflow) 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_deserializeOpErrorDeleteWorkflow(response, &metadata) } output := &DeleteWorkflowOutput{} 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_deserializeOpErrorDeleteWorkflow(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeAccess struct { } func (*awsAwsjson11_deserializeOpDescribeAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeAccess) 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_deserializeOpErrorDescribeAccess(response, &metadata) } output := &DescribeAccessOutput{} 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_deserializeOpDocumentDescribeAccessOutput(&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_deserializeOpErrorDescribeAccess(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeAgreement struct { } func (*awsAwsjson11_deserializeOpDescribeAgreement) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeAgreement) 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_deserializeOpErrorDescribeAgreement(response, &metadata) } output := &DescribeAgreementOutput{} 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_deserializeOpDocumentDescribeAgreementOutput(&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_deserializeOpErrorDescribeAgreement(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeCertificate struct { } func (*awsAwsjson11_deserializeOpDescribeCertificate) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeCertificate) 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_deserializeOpErrorDescribeCertificate(response, &metadata) } output := &DescribeCertificateOutput{} 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_deserializeOpDocumentDescribeCertificateOutput(&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_deserializeOpErrorDescribeCertificate(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeConnector struct { } func (*awsAwsjson11_deserializeOpDescribeConnector) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeConnector) 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_deserializeOpErrorDescribeConnector(response, &metadata) } output := &DescribeConnectorOutput{} 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_deserializeOpDocumentDescribeConnectorOutput(&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_deserializeOpErrorDescribeConnector(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeExecution struct { } func (*awsAwsjson11_deserializeOpDescribeExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeExecution) 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_deserializeOpErrorDescribeExecution(response, &metadata) } output := &DescribeExecutionOutput{} 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_deserializeOpDocumentDescribeExecutionOutput(&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_deserializeOpErrorDescribeExecution(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeHostKey struct { } func (*awsAwsjson11_deserializeOpDescribeHostKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeHostKey) 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_deserializeOpErrorDescribeHostKey(response, &metadata) } output := &DescribeHostKeyOutput{} 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_deserializeOpDocumentDescribeHostKeyOutput(&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_deserializeOpErrorDescribeHostKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeProfile struct { } func (*awsAwsjson11_deserializeOpDescribeProfile) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeProfile) 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_deserializeOpErrorDescribeProfile(response, &metadata) } output := &DescribeProfileOutput{} 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_deserializeOpDocumentDescribeProfileOutput(&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_deserializeOpErrorDescribeProfile(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeSecurityPolicy struct { } func (*awsAwsjson11_deserializeOpDescribeSecurityPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeSecurityPolicy) 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_deserializeOpErrorDescribeSecurityPolicy(response, &metadata) } output := &DescribeSecurityPolicyOutput{} 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_deserializeOpDocumentDescribeSecurityPolicyOutput(&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_deserializeOpErrorDescribeSecurityPolicy(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeServer struct { } func (*awsAwsjson11_deserializeOpDescribeServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeServer) 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_deserializeOpErrorDescribeServer(response, &metadata) } output := &DescribeServerOutput{} 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_deserializeOpDocumentDescribeServerOutput(&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_deserializeOpErrorDescribeServer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeUser struct { } func (*awsAwsjson11_deserializeOpDescribeUser) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDescribeUser(response, &metadata) } output := &DescribeUserOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDescribeUserOutput(&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_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeWorkflow struct { } func (*awsAwsjson11_deserializeOpDescribeWorkflow) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeWorkflow) 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_deserializeOpErrorDescribeWorkflow(response, &metadata) } output := &DescribeWorkflowOutput{} 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_deserializeOpDocumentDescribeWorkflowOutput(&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_deserializeOpErrorDescribeWorkflow(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportCertificate struct { } func (*awsAwsjson11_deserializeOpImportCertificate) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportCertificate) 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_deserializeOpErrorImportCertificate(response, &metadata) } output := &ImportCertificateOutput{} 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_deserializeOpDocumentImportCertificateOutput(&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_deserializeOpErrorImportCertificate(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportHostKey struct { } func (*awsAwsjson11_deserializeOpImportHostKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportHostKey) 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_deserializeOpErrorImportHostKey(response, &metadata) } output := &ImportHostKeyOutput{} 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_deserializeOpDocumentImportHostKeyOutput(&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_deserializeOpErrorImportHostKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportSshPublicKey struct { } func (*awsAwsjson11_deserializeOpImportSshPublicKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportSshPublicKey) 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_deserializeOpErrorImportSshPublicKey(response, &metadata) } output := &ImportSshPublicKeyOutput{} 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_deserializeOpDocumentImportSshPublicKeyOutput(&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_deserializeOpErrorImportSshPublicKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAccesses struct { } func (*awsAwsjson11_deserializeOpListAccesses) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAccesses) 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_deserializeOpErrorListAccesses(response, &metadata) } output := &ListAccessesOutput{} 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_deserializeOpDocumentListAccessesOutput(&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_deserializeOpErrorListAccesses(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAgreements struct { } func (*awsAwsjson11_deserializeOpListAgreements) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAgreements) 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_deserializeOpErrorListAgreements(response, &metadata) } output := &ListAgreementsOutput{} 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_deserializeOpDocumentListAgreementsOutput(&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_deserializeOpErrorListAgreements(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListCertificates struct { } func (*awsAwsjson11_deserializeOpListCertificates) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListCertificates) 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_deserializeOpErrorListCertificates(response, &metadata) } output := &ListCertificatesOutput{} 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_deserializeOpDocumentListCertificatesOutput(&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_deserializeOpErrorListCertificates(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListConnectors struct { } func (*awsAwsjson11_deserializeOpListConnectors) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListConnectors) 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_deserializeOpErrorListConnectors(response, &metadata) } output := &ListConnectorsOutput{} 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_deserializeOpDocumentListConnectorsOutput(&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_deserializeOpErrorListConnectors(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListExecutions struct { } func (*awsAwsjson11_deserializeOpListExecutions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListExecutions) 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_deserializeOpErrorListExecutions(response, &metadata) } output := &ListExecutionsOutput{} 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_deserializeOpDocumentListExecutionsOutput(&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_deserializeOpErrorListExecutions(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListHostKeys struct { } func (*awsAwsjson11_deserializeOpListHostKeys) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListHostKeys) 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_deserializeOpErrorListHostKeys(response, &metadata) } output := &ListHostKeysOutput{} 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_deserializeOpDocumentListHostKeysOutput(&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_deserializeOpErrorListHostKeys(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListProfiles struct { } func (*awsAwsjson11_deserializeOpListProfiles) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListProfiles) 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_deserializeOpErrorListProfiles(response, &metadata) } output := &ListProfilesOutput{} 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_deserializeOpDocumentListProfilesOutput(&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_deserializeOpErrorListProfiles(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListSecurityPolicies struct { } func (*awsAwsjson11_deserializeOpListSecurityPolicies) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListSecurityPolicies) 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_deserializeOpErrorListSecurityPolicies(response, &metadata) } output := &ListSecurityPoliciesOutput{} 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_deserializeOpDocumentListSecurityPoliciesOutput(&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_deserializeOpErrorListSecurityPolicies(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListServers struct { } func (*awsAwsjson11_deserializeOpListServers) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListServers) 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_deserializeOpErrorListServers(response, &metadata) } output := &ListServersOutput{} 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_deserializeOpDocumentListServersOutput(&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_deserializeOpErrorListServers(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListUsers struct { } func (*awsAwsjson11_deserializeOpListUsers) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) } output := &ListUsersOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&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_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListWorkflows struct { } func (*awsAwsjson11_deserializeOpListWorkflows) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListWorkflows) 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_deserializeOpErrorListWorkflows(response, &metadata) } output := &ListWorkflowsOutput{} 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_deserializeOpDocumentListWorkflowsOutput(&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_deserializeOpErrorListWorkflows(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpSendWorkflowStepState struct { } func (*awsAwsjson11_deserializeOpSendWorkflowStepState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpSendWorkflowStepState) 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_deserializeOpErrorSendWorkflowStepState(response, &metadata) } output := &SendWorkflowStepStateOutput{} 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_deserializeOpDocumentSendWorkflowStepStateOutput(&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_deserializeOpErrorSendWorkflowStepState(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartFileTransfer struct { } func (*awsAwsjson11_deserializeOpStartFileTransfer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartFileTransfer) 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_deserializeOpErrorStartFileTransfer(response, &metadata) } output := &StartFileTransferOutput{} 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_deserializeOpDocumentStartFileTransferOutput(&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_deserializeOpErrorStartFileTransfer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartServer struct { } func (*awsAwsjson11_deserializeOpStartServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartServer) 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_deserializeOpErrorStartServer(response, &metadata) } output := &StartServerOutput{} 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_deserializeOpErrorStartServer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStopServer struct { } func (*awsAwsjson11_deserializeOpStopServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStopServer) 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_deserializeOpErrorStopServer(response, &metadata) } output := &StopServerOutput{} 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_deserializeOpErrorStopServer(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTestIdentityProvider struct { } func (*awsAwsjson11_deserializeOpTestIdentityProvider) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTestIdentityProvider) 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_deserializeOpErrorTestIdentityProvider(response, &metadata) } output := &TestIdentityProviderOutput{} 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_deserializeOpDocumentTestIdentityProviderOutput(&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_deserializeOpErrorTestIdentityProvider(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateAccess struct { } func (*awsAwsjson11_deserializeOpUpdateAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateAccess) 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_deserializeOpErrorUpdateAccess(response, &metadata) } output := &UpdateAccessOutput{} 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_deserializeOpDocumentUpdateAccessOutput(&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_deserializeOpErrorUpdateAccess(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateAgreement struct { } func (*awsAwsjson11_deserializeOpUpdateAgreement) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateAgreement) 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_deserializeOpErrorUpdateAgreement(response, &metadata) } output := &UpdateAgreementOutput{} 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_deserializeOpDocumentUpdateAgreementOutput(&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_deserializeOpErrorUpdateAgreement(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateCertificate struct { } func (*awsAwsjson11_deserializeOpUpdateCertificate) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateCertificate) 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_deserializeOpErrorUpdateCertificate(response, &metadata) } output := &UpdateCertificateOutput{} 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_deserializeOpDocumentUpdateCertificateOutput(&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_deserializeOpErrorUpdateCertificate(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateConnector struct { } func (*awsAwsjson11_deserializeOpUpdateConnector) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateConnector) 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_deserializeOpErrorUpdateConnector(response, &metadata) } output := &UpdateConnectorOutput{} 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_deserializeOpDocumentUpdateConnectorOutput(&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_deserializeOpErrorUpdateConnector(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateHostKey struct { } func (*awsAwsjson11_deserializeOpUpdateHostKey) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateHostKey) 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_deserializeOpErrorUpdateHostKey(response, &metadata) } output := &UpdateHostKeyOutput{} 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_deserializeOpDocumentUpdateHostKeyOutput(&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_deserializeOpErrorUpdateHostKey(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateProfile struct { } func (*awsAwsjson11_deserializeOpUpdateProfile) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateProfile) 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_deserializeOpErrorUpdateProfile(response, &metadata) } output := &UpdateProfileOutput{} 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_deserializeOpDocumentUpdateProfileOutput(&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_deserializeOpErrorUpdateProfile(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("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateServer struct { } func (*awsAwsjson11_deserializeOpUpdateServer) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateServer) 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_deserializeOpErrorUpdateServer(response, &metadata) } output := &UpdateServerOutput{} 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_deserializeOpDocumentUpdateServerOutput(&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_deserializeOpErrorUpdateServer(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("ConflictException", errorCode): return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateUser struct { } func (*awsAwsjson11_deserializeOpUpdateUser) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUpdateUser(response, &metadata) } output := &UpdateUserOutput{} 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_deserializeOpDocumentUpdateUserOutput(&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_deserializeOpErrorUpdateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(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_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_deserializeErrorInternalServiceError(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.InternalServiceError{} err := awsAwsjson11_deserializeDocumentInternalServiceError(&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_deserializeErrorInvalidNextTokenException(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.InvalidNextTokenException{} err := awsAwsjson11_deserializeDocumentInvalidNextTokenException(&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_deserializeErrorInvalidRequestException(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.InvalidRequestException{} err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorResourceExistsException(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.ResourceExistsException{} err := awsAwsjson11_deserializeDocumentResourceExistsException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceNotFoundException{} err := awsAwsjson11_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 awsAwsjson11_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{} err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ThrottlingException{} err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func 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 ServiceErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAddressAllocationIds(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 AddressAllocationId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentAs2ConnectorConfig(v **types.As2ConnectorConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.As2ConnectorConfig if *v == nil { sv = &types.As2ConnectorConfig{} } else { sv = *v } for key, value := range shape { switch key { case "BasicAuthSecretId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected As2ConnectorSecretId to be of type string, got %T instead", value) } sv.BasicAuthSecretId = ptr.String(jtv) } case "Compression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CompressionEnum to be of type string, got %T instead", value) } sv.Compression = types.CompressionEnum(jtv) } case "EncryptionAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EncryptionAlg to be of type string, got %T instead", value) } sv.EncryptionAlgorithm = types.EncryptionAlg(jtv) } case "LocalProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.LocalProfileId = ptr.String(jtv) } case "MdnResponse": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MdnResponse to be of type string, got %T instead", value) } sv.MdnResponse = types.MdnResponse(jtv) } case "MdnSigningAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MdnSigningAlg to be of type string, got %T instead", value) } sv.MdnSigningAlgorithm = types.MdnSigningAlg(jtv) } case "MessageSubject": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MessageSubject to be of type string, got %T instead", value) } sv.MessageSubject = ptr.String(jtv) } case "PartnerProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.PartnerProfileId = ptr.String(jtv) } case "SigningAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SigningAlg to be of type string, got %T instead", value) } sv.SigningAlgorithm = types.SigningAlg(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAs2Transports(v *[]types.As2Transport, 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.As2Transport if *v == nil { cv = []types.As2Transport{} } else { cv = *v } for _, value := range shape { var col types.As2Transport if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected As2Transport to be of type string, got %T instead", value) } col = types.As2Transport(jtv) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentCertificateIds(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 CertificateId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv 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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCopyStepDetails(v **types.CopyStepDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CopyStepDetails if *v == nil { sv = &types.CopyStepDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationFileLocation": if err := awsAwsjson11_deserializeDocumentInputFileLocation(&sv.DestinationFileLocation, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OverwriteExisting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OverwriteExisting to be of type string, got %T instead", value) } sv.OverwriteExisting = types.OverwriteExisting(jtv) } case "SourceFileLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceFileLocation to be of type string, got %T instead", value) } sv.SourceFileLocation = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCustomStepDetails(v **types.CustomStepDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomStepDetails if *v == nil { sv = &types.CustomStepDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SourceFileLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceFileLocation to be of type string, got %T instead", value) } sv.SourceFileLocation = ptr.String(jtv) } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomStepTarget to be of type string, got %T instead", value) } sv.Target = ptr.String(jtv) } case "TimeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CustomStepTimeoutSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDecryptStepDetails(v **types.DecryptStepDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecryptStepDetails if *v == nil { sv = &types.DecryptStepDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationFileLocation": if err := awsAwsjson11_deserializeDocumentInputFileLocation(&sv.DestinationFileLocation, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OverwriteExisting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OverwriteExisting to be of type string, got %T instead", value) } sv.OverwriteExisting = types.OverwriteExisting(jtv) } case "SourceFileLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceFileLocation to be of type string, got %T instead", value) } sv.SourceFileLocation = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) } sv.Type = types.EncryptionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDeleteStepDetails(v **types.DeleteStepDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DeleteStepDetails if *v == nil { sv = &types.DeleteStepDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SourceFileLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceFileLocation to be of type string, got %T instead", value) } sv.SourceFileLocation = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedAccess(v **types.DescribedAccess, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedAccess if *v == nil { sv = &types.DescribedAccess{} } else { sv = *v } for key, value := range shape { switch key { case "ExternalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } sv.ExternalId = ptr.String(jtv) } case "HomeDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectory to be of type string, got %T instead", value) } sv.HomeDirectory = ptr.String(jtv) } case "HomeDirectoryMappings": if err := awsAwsjson11_deserializeDocumentHomeDirectoryMappings(&sv.HomeDirectoryMappings, value); err != nil { return err } case "HomeDirectoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectoryType to be of type string, got %T instead", value) } sv.HomeDirectoryType = types.HomeDirectoryType(jtv) } case "Policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Policy to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "PosixProfile": if err := awsAwsjson11_deserializeDocumentPosixProfile(&sv.PosixProfile, value); err != nil { return err } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedAgreement(v **types.DescribedAgreement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedAgreement if *v == nil { sv = &types.DescribedAgreement{} } else { sv = *v } for key, value := range shape { switch key { case "AccessRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.AccessRole = ptr.String(jtv) } case "AgreementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementId to be of type string, got %T instead", value) } sv.AgreementId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "BaseDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectory to be of type string, got %T instead", value) } sv.BaseDirectory = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "LocalProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.LocalProfileId = ptr.String(jtv) } case "PartnerProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.PartnerProfileId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementStatusType to be of type string, got %T instead", value) } sv.Status = types.AgreementStatusType(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedCertificate(v **types.DescribedCertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedCertificate if *v == nil { sv = &types.DescribedCertificate{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ActiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Certificate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateBodyType to be of type string, got %T instead", value) } sv.Certificate = ptr.String(jtv) } case "CertificateChain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateChainType to be of type string, got %T instead", value) } sv.CertificateChain = ptr.String(jtv) } case "CertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } sv.CertificateId = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "InactiveDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.InactiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "NotAfterDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.NotAfterDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "NotBeforeDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.NotBeforeDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "Serial": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertSerial to be of type string, got %T instead", value) } sv.Serial = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateStatusType to be of type string, got %T instead", value) } sv.Status = types.CertificateStatusType(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateType to be of type string, got %T instead", value) } sv.Type = types.CertificateType(jtv) } case "Usage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateUsageType to be of type string, got %T instead", value) } sv.Usage = types.CertificateUsageType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedConnector(v **types.DescribedConnector, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedConnector if *v == nil { sv = &types.DescribedConnector{} } else { sv = *v } for key, value := range shape { switch key { case "AccessRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.AccessRole = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "As2Config": if err := awsAwsjson11_deserializeDocumentAs2ConnectorConfig(&sv.As2Config, value); err != nil { return err } case "ConnectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorId to be of type string, got %T instead", value) } sv.ConnectorId = ptr.String(jtv) } case "LoggingRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.LoggingRole = ptr.String(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Url to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedExecution(v **types.DescribedExecution, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedExecution if *v == nil { sv = &types.DescribedExecution{} } else { sv = *v } for key, value := range shape { switch key { case "ExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionId to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } case "ExecutionRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.ExecutionRole = ptr.String(jtv) } case "InitialFileLocation": if err := awsAwsjson11_deserializeDocumentFileLocation(&sv.InitialFileLocation, value); err != nil { return err } case "LoggingConfiguration": if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { return err } case "PosixProfile": if err := awsAwsjson11_deserializeDocumentPosixProfile(&sv.PosixProfile, value); err != nil { return err } case "Results": if err := awsAwsjson11_deserializeDocumentExecutionResults(&sv.Results, value); err != nil { return err } case "ServiceMetadata": if err := awsAwsjson11_deserializeDocumentServiceMetadata(&sv.ServiceMetadata, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.ExecutionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedHostKey(v **types.DescribedHostKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedHostKey if *v == nil { sv = &types.DescribedHostKey{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DateImported": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateImported = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateImported to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "HostKeyFingerprint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyFingerprint to be of type string, got %T instead", value) } sv.HostKeyFingerprint = ptr.String(jtv) } case "HostKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyId to be of type string, got %T instead", value) } sv.HostKeyId = ptr.String(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedProfile(v **types.DescribedProfile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedProfile if *v == nil { sv = &types.DescribedProfile{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "As2Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected As2Id to be of type string, got %T instead", value) } sv.As2Id = ptr.String(jtv) } case "CertificateIds": if err := awsAwsjson11_deserializeDocumentCertificateIds(&sv.CertificateIds, value); err != nil { return err } case "ProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.ProfileId = ptr.String(jtv) } case "ProfileType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileType to be of type string, got %T instead", value) } sv.ProfileType = types.ProfileType(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedSecurityPolicy(v **types.DescribedSecurityPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedSecurityPolicy if *v == nil { sv = &types.DescribedSecurityPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "Fips": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Fips to be of type *bool, got %T instead", value) } sv.Fips = ptr.Bool(jtv) } case "SecurityPolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityPolicyName to be of type string, got %T instead", value) } sv.SecurityPolicyName = ptr.String(jtv) } case "SshCiphers": if err := awsAwsjson11_deserializeDocumentSecurityPolicyOptions(&sv.SshCiphers, value); err != nil { return err } case "SshKexs": if err := awsAwsjson11_deserializeDocumentSecurityPolicyOptions(&sv.SshKexs, value); err != nil { return err } case "SshMacs": if err := awsAwsjson11_deserializeDocumentSecurityPolicyOptions(&sv.SshMacs, value); err != nil { return err } case "TlsCiphers": if err := awsAwsjson11_deserializeDocumentSecurityPolicyOptions(&sv.TlsCiphers, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedServer(v **types.DescribedServer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedServer if *v == nil { sv = &types.DescribedServer{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Certificate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Certificate to be of type string, got %T instead", value) } sv.Certificate = ptr.String(jtv) } case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Domain to be of type string, got %T instead", value) } sv.Domain = types.Domain(jtv) } case "EndpointDetails": if err := awsAwsjson11_deserializeDocumentEndpointDetails(&sv.EndpointDetails, value); err != nil { return err } case "EndpointType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EndpointType to be of type string, got %T instead", value) } sv.EndpointType = types.EndpointType(jtv) } case "HostKeyFingerprint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyFingerprint to be of type string, got %T instead", value) } sv.HostKeyFingerprint = ptr.String(jtv) } case "IdentityProviderDetails": if err := awsAwsjson11_deserializeDocumentIdentityProviderDetails(&sv.IdentityProviderDetails, value); err != nil { return err } case "IdentityProviderType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityProviderType to be of type string, got %T instead", value) } sv.IdentityProviderType = types.IdentityProviderType(jtv) } case "LoggingRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.LoggingRole = ptr.String(jtv) } case "PostAuthenticationLoginBanner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PostAuthenticationLoginBanner to be of type string, got %T instead", value) } sv.PostAuthenticationLoginBanner = ptr.String(jtv) } case "PreAuthenticationLoginBanner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PreAuthenticationLoginBanner to be of type string, got %T instead", value) } sv.PreAuthenticationLoginBanner = ptr.String(jtv) } case "ProtocolDetails": if err := awsAwsjson11_deserializeDocumentProtocolDetails(&sv.ProtocolDetails, value); err != nil { return err } case "Protocols": if err := awsAwsjson11_deserializeDocumentProtocols(&sv.Protocols, value); err != nil { return err } case "SecurityPolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityPolicyName to be of type string, got %T instead", value) } sv.SecurityPolicyName = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected State to be of type string, got %T instead", value) } sv.State = types.State(jtv) } case "StructuredLogDestinations": if err := awsAwsjson11_deserializeDocumentStructuredLogDestinations(&sv.StructuredLogDestinations, value); err != nil { return err } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "UserCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UserCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.UserCount = ptr.Int32(int32(i64)) } case "WorkflowDetails": if err := awsAwsjson11_deserializeDocumentWorkflowDetails(&sv.WorkflowDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedUser(v **types.DescribedUser, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedUser if *v == nil { sv = &types.DescribedUser{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "HomeDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectory to be of type string, got %T instead", value) } sv.HomeDirectory = ptr.String(jtv) } case "HomeDirectoryMappings": if err := awsAwsjson11_deserializeDocumentHomeDirectoryMappings(&sv.HomeDirectoryMappings, value); err != nil { return err } case "HomeDirectoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectoryType to be of type string, got %T instead", value) } sv.HomeDirectoryType = types.HomeDirectoryType(jtv) } case "Policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Policy to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "PosixProfile": if err := awsAwsjson11_deserializeDocumentPosixProfile(&sv.PosixProfile, value); err != nil { return err } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } case "SshPublicKeys": if err := awsAwsjson11_deserializeDocumentSshPublicKeys(&sv.SshPublicKeys, value); err != nil { return err } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDescribedWorkflow(v **types.DescribedWorkflow, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DescribedWorkflow if *v == nil { sv = &types.DescribedWorkflow{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "OnExceptionSteps": if err := awsAwsjson11_deserializeDocumentWorkflowSteps(&sv.OnExceptionSteps, value); err != nil { return err } case "Steps": if err := awsAwsjson11_deserializeDocumentWorkflowSteps(&sv.Steps, value); err != nil { return err } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEfsFileLocation(v **types.EfsFileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EfsFileLocation if *v == nil { sv = &types.EfsFileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "FileSystemId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EfsFileSystemId to be of type string, got %T instead", value) } sv.FileSystemId = ptr.String(jtv) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EfsPath to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEndpointDetails(v **types.EndpointDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EndpointDetails if *v == nil { sv = &types.EndpointDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AddressAllocationIds": if err := awsAwsjson11_deserializeDocumentAddressAllocationIds(&sv.AddressAllocationIds, value); err != nil { return err } case "SecurityGroupIds": if err := awsAwsjson11_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsAwsjson11_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { return err } case "VpcEndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId 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 VpcId to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExecutionError(v **types.ExecutionError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExecutionError if *v == nil { sv = &types.ExecutionError{} } 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 ExecutionErrorMessage 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 ExecutionErrorType to be of type string, got %T instead", value) } sv.Type = types.ExecutionErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExecutionResults(v **types.ExecutionResults, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExecutionResults if *v == nil { sv = &types.ExecutionResults{} } else { sv = *v } for key, value := range shape { switch key { case "OnExceptionSteps": if err := awsAwsjson11_deserializeDocumentExecutionStepResults(&sv.OnExceptionSteps, value); err != nil { return err } case "Steps": if err := awsAwsjson11_deserializeDocumentExecutionStepResults(&sv.Steps, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExecutionStepResult(v **types.ExecutionStepResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExecutionStepResult if *v == nil { sv = &types.ExecutionStepResult{} } else { sv = *v } for key, value := range shape { switch key { case "Error": if err := awsAwsjson11_deserializeDocumentExecutionError(&sv.Error, value); err != nil { return err } case "Outputs": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StepResultOutputsJson to be of type string, got %T instead", value) } sv.Outputs = ptr.String(jtv) } case "StepType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepType to be of type string, got %T instead", value) } sv.StepType = types.WorkflowStepType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExecutionStepResults(v *[]types.ExecutionStepResult, 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.ExecutionStepResult if *v == nil { cv = []types.ExecutionStepResult{} } else { cv = *v } for _, value := range shape { var col types.ExecutionStepResult destAddr := &col if err := awsAwsjson11_deserializeDocumentExecutionStepResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentFileLocation(v **types.FileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FileLocation if *v == nil { sv = &types.FileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "EfsFileLocation": if err := awsAwsjson11_deserializeDocumentEfsFileLocation(&sv.EfsFileLocation, value); err != nil { return err } case "S3FileLocation": if err := awsAwsjson11_deserializeDocumentS3FileLocation(&sv.S3FileLocation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHomeDirectoryMapEntry(v **types.HomeDirectoryMapEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HomeDirectoryMapEntry if *v == nil { sv = &types.HomeDirectoryMapEntry{} } else { sv = *v } for key, value := range shape { switch key { case "Entry": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapEntry to be of type string, got %T instead", value) } sv.Entry = ptr.String(jtv) } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapTarget to be of type string, got %T instead", value) } sv.Target = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHomeDirectoryMappings(v *[]types.HomeDirectoryMapEntry, 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.HomeDirectoryMapEntry if *v == nil { cv = []types.HomeDirectoryMapEntry{} } else { cv = *v } for _, value := range shape { var col types.HomeDirectoryMapEntry destAddr := &col if err := awsAwsjson11_deserializeDocumentHomeDirectoryMapEntry(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentIdentityProviderDetails(v **types.IdentityProviderDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IdentityProviderDetails if *v == nil { sv = &types.IdentityProviderDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DirectoryId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DirectoryId to be of type string, got %T instead", value) } sv.DirectoryId = ptr.String(jtv) } case "Function": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Function to be of type string, got %T instead", value) } sv.Function = ptr.String(jtv) } case "InvocationRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.InvocationRole = ptr.String(jtv) } case "SftpAuthenticationMethods": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SftpAuthenticationMethods to be of type string, got %T instead", value) } sv.SftpAuthenticationMethods = types.SftpAuthenticationMethods(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Url to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInputFileLocation(v **types.InputFileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InputFileLocation if *v == nil { sv = &types.InputFileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "EfsFileLocation": if err := awsAwsjson11_deserializeDocumentEfsFileLocation(&sv.EfsFileLocation, value); err != nil { return err } case "S3FileLocation": if err := awsAwsjson11_deserializeDocumentS3InputFileLocation(&sv.S3FileLocation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInternalServiceError(v **types.InternalServiceError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalServiceError if *v == nil { sv = &types.InternalServiceError{} } 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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidNextTokenException if *v == nil { sv = &types.InvalidNextTokenException{} } 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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidRequestException if *v == nil { sv = &types.InvalidRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedAccess(v **types.ListedAccess, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedAccess if *v == nil { sv = &types.ListedAccess{} } else { sv = *v } for key, value := range shape { switch key { case "ExternalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } sv.ExternalId = ptr.String(jtv) } case "HomeDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectory to be of type string, got %T instead", value) } sv.HomeDirectory = ptr.String(jtv) } case "HomeDirectoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectoryType to be of type string, got %T instead", value) } sv.HomeDirectoryType = types.HomeDirectoryType(jtv) } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedAccesses(v *[]types.ListedAccess, 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.ListedAccess if *v == nil { cv = []types.ListedAccess{} } else { cv = *v } for _, value := range shape { var col types.ListedAccess destAddr := &col if err := awsAwsjson11_deserializeDocumentListedAccess(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedAgreement(v **types.ListedAgreement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedAgreement if *v == nil { sv = &types.ListedAgreement{} } else { sv = *v } for key, value := range shape { switch key { case "AgreementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementId to be of type string, got %T instead", value) } sv.AgreementId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "LocalProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.LocalProfileId = ptr.String(jtv) } case "PartnerProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.PartnerProfileId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementStatusType to be of type string, got %T instead", value) } sv.Status = types.AgreementStatusType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedAgreements(v *[]types.ListedAgreement, 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.ListedAgreement if *v == nil { cv = []types.ListedAgreement{} } else { cv = *v } for _, value := range shape { var col types.ListedAgreement destAddr := &col if err := awsAwsjson11_deserializeDocumentListedAgreement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedCertificate(v **types.ListedCertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedCertificate if *v == nil { sv = &types.ListedCertificate{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ActiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } sv.CertificateId = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "InactiveDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.InactiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CertDate to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateStatusType to be of type string, got %T instead", value) } sv.Status = types.CertificateStatusType(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateType to be of type string, got %T instead", value) } sv.Type = types.CertificateType(jtv) } case "Usage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateUsageType to be of type string, got %T instead", value) } sv.Usage = types.CertificateUsageType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedCertificates(v *[]types.ListedCertificate, 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.ListedCertificate if *v == nil { cv = []types.ListedCertificate{} } else { cv = *v } for _, value := range shape { var col types.ListedCertificate destAddr := &col if err := awsAwsjson11_deserializeDocumentListedCertificate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedConnector(v **types.ListedConnector, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedConnector if *v == nil { sv = &types.ListedConnector{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ConnectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorId to be of type string, got %T instead", value) } sv.ConnectorId = ptr.String(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Url to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedConnectors(v *[]types.ListedConnector, 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.ListedConnector if *v == nil { cv = []types.ListedConnector{} } else { cv = *v } for _, value := range shape { var col types.ListedConnector destAddr := &col if err := awsAwsjson11_deserializeDocumentListedConnector(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedExecution(v **types.ListedExecution, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedExecution if *v == nil { sv = &types.ListedExecution{} } else { sv = *v } for key, value := range shape { switch key { case "ExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionId to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } case "InitialFileLocation": if err := awsAwsjson11_deserializeDocumentFileLocation(&sv.InitialFileLocation, value); err != nil { return err } case "ServiceMetadata": if err := awsAwsjson11_deserializeDocumentServiceMetadata(&sv.ServiceMetadata, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.ExecutionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedExecutions(v *[]types.ListedExecution, 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.ListedExecution if *v == nil { cv = []types.ListedExecution{} } else { cv = *v } for _, value := range shape { var col types.ListedExecution destAddr := &col if err := awsAwsjson11_deserializeDocumentListedExecution(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedHostKey(v **types.ListedHostKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedHostKey if *v == nil { sv = &types.ListedHostKey{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DateImported": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateImported = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateImported to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Fingerprint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyFingerprint to be of type string, got %T instead", value) } sv.Fingerprint = ptr.String(jtv) } case "HostKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyId to be of type string, got %T instead", value) } sv.HostKeyId = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedHostKeys(v *[]types.ListedHostKey, 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.ListedHostKey if *v == nil { cv = []types.ListedHostKey{} } else { cv = *v } for _, value := range shape { var col types.ListedHostKey destAddr := &col if err := awsAwsjson11_deserializeDocumentListedHostKey(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedProfile(v **types.ListedProfile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedProfile if *v == nil { sv = &types.ListedProfile{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "As2Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected As2Id to be of type string, got %T instead", value) } sv.As2Id = ptr.String(jtv) } case "ProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.ProfileId = ptr.String(jtv) } case "ProfileType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileType to be of type string, got %T instead", value) } sv.ProfileType = types.ProfileType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedProfiles(v *[]types.ListedProfile, 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.ListedProfile if *v == nil { cv = []types.ListedProfile{} } else { cv = *v } for _, value := range shape { var col types.ListedProfile destAddr := &col if err := awsAwsjson11_deserializeDocumentListedProfile(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedServer(v **types.ListedServer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedServer if *v == nil { sv = &types.ListedServer{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Domain to be of type string, got %T instead", value) } sv.Domain = types.Domain(jtv) } case "EndpointType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EndpointType to be of type string, got %T instead", value) } sv.EndpointType = types.EndpointType(jtv) } case "IdentityProviderType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityProviderType to be of type string, got %T instead", value) } sv.IdentityProviderType = types.IdentityProviderType(jtv) } case "LoggingRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.LoggingRole = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected State to be of type string, got %T instead", value) } sv.State = types.State(jtv) } case "UserCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UserCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.UserCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedServers(v *[]types.ListedServer, 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.ListedServer if *v == nil { cv = []types.ListedServer{} } else { cv = *v } for _, value := range shape { var col types.ListedServer destAddr := &col if err := awsAwsjson11_deserializeDocumentListedServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedUser(v **types.ListedUser, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedUser if *v == nil { sv = &types.ListedUser{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "HomeDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectory to be of type string, got %T instead", value) } sv.HomeDirectory = ptr.String(jtv) } case "HomeDirectoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeDirectoryType to be of type string, got %T instead", value) } sv.HomeDirectoryType = types.HomeDirectoryType(jtv) } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } case "SshPublicKeyCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SshPublicKeyCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SshPublicKeyCount = ptr.Int32(int32(i64)) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedUsers(v *[]types.ListedUser, 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.ListedUser if *v == nil { cv = []types.ListedUser{} } else { cv = *v } for _, value := range shape { var col types.ListedUser destAddr := &col if err := awsAwsjson11_deserializeDocumentListedUser(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListedWorkflow(v **types.ListedWorkflow, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListedWorkflow if *v == nil { sv = &types.ListedWorkflow{} } 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 Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListedWorkflows(v *[]types.ListedWorkflow, 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.ListedWorkflow if *v == nil { cv = []types.ListedWorkflow{} } else { cv = *v } for _, value := range shape { var col types.ListedWorkflow destAddr := &col if err := awsAwsjson11_deserializeDocumentListedWorkflow(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LoggingConfiguration if *v == nil { sv = &types.LoggingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "LoggingRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.LoggingRole = ptr.String(jtv) } case "LogGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) } sv.LogGroupName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOnPartialUploadWorkflowDetails(v *[]types.WorkflowDetail, 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.WorkflowDetail if *v == nil { cv = []types.WorkflowDetail{} } else { cv = *v } for _, value := range shape { var col types.WorkflowDetail destAddr := &col if err := awsAwsjson11_deserializeDocumentWorkflowDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentOnUploadWorkflowDetails(v *[]types.WorkflowDetail, 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.WorkflowDetail if *v == nil { cv = []types.WorkflowDetail{} } else { cv = *v } for _, value := range shape { var col types.WorkflowDetail destAddr := &col if err := awsAwsjson11_deserializeDocumentWorkflowDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPosixProfile(v **types.PosixProfile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PosixProfile if *v == nil { sv = &types.PosixProfile{} } else { sv = *v } for key, value := range shape { switch key { case "Gid": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PosixId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Gid = ptr.Int64(i64) } case "SecondaryGids": if err := awsAwsjson11_deserializeDocumentSecondaryGids(&sv.SecondaryGids, value); err != nil { return err } case "Uid": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PosixId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Uid = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProtocolDetails(v **types.ProtocolDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ProtocolDetails if *v == nil { sv = &types.ProtocolDetails{} } else { sv = *v } for key, value := range shape { switch key { case "As2Transports": if err := awsAwsjson11_deserializeDocumentAs2Transports(&sv.As2Transports, value); err != nil { return err } case "PassiveIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PassiveIp to be of type string, got %T instead", value) } sv.PassiveIp = ptr.String(jtv) } case "SetStatOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SetStatOption to be of type string, got %T instead", value) } sv.SetStatOption = types.SetStatOption(jtv) } case "TlsSessionResumptionMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TlsSessionResumptionMode to be of type string, got %T instead", value) } sv.TlsSessionResumptionMode = types.TlsSessionResumptionMode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProtocols(v *[]types.Protocol, 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.Protocol if *v == nil { cv = []types.Protocol{} } else { cv = *v } for _, value := range shape { var col types.Protocol if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Protocol to be of type string, got %T instead", value) } col = types.Protocol(jtv) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentResourceExistsException(v **types.ResourceExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourceExistsException if *v == nil { sv = &types.ResourceExistsException{} } 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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Resource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Resource to be of type string, got %T instead", value) } sv.Resource = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Resource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Resource to be of type string, got %T instead", value) } sv.Resource = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3FileLocation(v **types.S3FileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3FileLocation if *v == nil { sv = &types.S3FileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "Etag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Etag to be of type string, got %T instead", value) } sv.Etag = ptr.String(jtv) } case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3VersionId to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3InputFileLocation(v **types.S3InputFileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3InputFileLocation if *v == nil { sv = &types.S3InputFileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3Tag(v **types.S3Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3Tag if *v == nil { sv = &types.S3Tag{} } 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 S3TagKey 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 S3TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3Tags(v *[]types.S3Tag, 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.S3Tag if *v == nil { cv = []types.S3Tag{} } else { cv = *v } for _, value := range shape { var col types.S3Tag destAddr := &col if err := awsAwsjson11_deserializeDocumentS3Tag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentSecondaryGids(v *[]int64, 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 []int64 if *v == nil { cv = []int64{} } else { cv = *v } for _, value := range shape { var col int64 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PosixId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = i64 } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_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 awsAwsjson11_deserializeDocumentSecurityPolicyNames(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 SecurityPolicyName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentSecurityPolicyOptions(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 SecurityPolicyOption to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServiceMetadata(v **types.ServiceMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServiceMetadata if *v == nil { sv = &types.ServiceMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "UserDetails": if err := awsAwsjson11_deserializeDocumentUserDetails(&sv.UserDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServiceErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSshPublicKey(v **types.SshPublicKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SshPublicKey if *v == nil { sv = &types.SshPublicKey{} } else { sv = *v } for key, value := range shape { switch key { case "DateImported": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateImported = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateImported to be a JSON Number, got %T instead", value) } } case "SshPublicKeyBody": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SshPublicKeyBody to be of type string, got %T instead", value) } sv.SshPublicKeyBody = ptr.String(jtv) } case "SshPublicKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SshPublicKeyId to be of type string, got %T instead", value) } sv.SshPublicKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSshPublicKeys(v *[]types.SshPublicKey, 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.SshPublicKey if *v == nil { cv = []types.SshPublicKey{} } else { cv = *v } for _, value := range shape { var col types.SshPublicKey destAddr := &col if err := awsAwsjson11_deserializeDocumentSshPublicKey(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentStructuredLogDestinations(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 Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_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 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_deserializeDocumentTagStepDetails(v **types.TagStepDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TagStepDetails if *v == nil { sv = &types.TagStepDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SourceFileLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceFileLocation to be of type string, got %T instead", value) } sv.SourceFileLocation = ptr.String(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentS3Tags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { case "RetryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RetryAfterSeconds to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUserDetails(v **types.UserDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UserDetails if *v == nil { sv = &types.UserDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "SessionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) } sv.SessionId = ptr.String(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWorkflowDetail(v **types.WorkflowDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WorkflowDetail if *v == nil { sv = &types.WorkflowDetail{} } else { sv = *v } for key, value := range shape { switch key { case "ExecutionRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Role to be of type string, got %T instead", value) } sv.ExecutionRole = ptr.String(jtv) } case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWorkflowDetails(v **types.WorkflowDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WorkflowDetails if *v == nil { sv = &types.WorkflowDetails{} } else { sv = *v } for key, value := range shape { switch key { case "OnPartialUpload": if err := awsAwsjson11_deserializeDocumentOnPartialUploadWorkflowDetails(&sv.OnPartialUpload, value); err != nil { return err } case "OnUpload": if err := awsAwsjson11_deserializeDocumentOnUploadWorkflowDetails(&sv.OnUpload, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWorkflowStep(v **types.WorkflowStep, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WorkflowStep if *v == nil { sv = &types.WorkflowStep{} } else { sv = *v } for key, value := range shape { switch key { case "CopyStepDetails": if err := awsAwsjson11_deserializeDocumentCopyStepDetails(&sv.CopyStepDetails, value); err != nil { return err } case "CustomStepDetails": if err := awsAwsjson11_deserializeDocumentCustomStepDetails(&sv.CustomStepDetails, value); err != nil { return err } case "DecryptStepDetails": if err := awsAwsjson11_deserializeDocumentDecryptStepDetails(&sv.DecryptStepDetails, value); err != nil { return err } case "DeleteStepDetails": if err := awsAwsjson11_deserializeDocumentDeleteStepDetails(&sv.DeleteStepDetails, value); err != nil { return err } case "TagStepDetails": if err := awsAwsjson11_deserializeDocumentTagStepDetails(&sv.TagStepDetails, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepType to be of type string, got %T instead", value) } sv.Type = types.WorkflowStepType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWorkflowSteps(v *[]types.WorkflowStep, 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.WorkflowStep if *v == nil { cv = []types.WorkflowStep{} } else { cv = *v } for _, value := range shape { var col types.WorkflowStep destAddr := &col if err := awsAwsjson11_deserializeDocumentWorkflowStep(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeOpDocumentCreateAccessOutput(v **CreateAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAccessOutput if *v == nil { sv = &CreateAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ExternalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } sv.ExternalId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateAgreementOutput(v **CreateAgreementOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAgreementOutput if *v == nil { sv = &CreateAgreementOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AgreementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementId to be of type string, got %T instead", value) } sv.AgreementId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateConnectorOutput(v **CreateConnectorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateConnectorOutput if *v == nil { sv = &CreateConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ConnectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorId to be of type string, got %T instead", value) } sv.ConnectorId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateProfileOutput(v **CreateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateProfileOutput if *v == nil { sv = &CreateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.ProfileId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateServerOutput(v **CreateServerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateServerOutput if *v == nil { sv = &CreateServerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateUserOutput(v **CreateUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateUserOutput if *v == nil { sv = &CreateUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateWorkflowOutput(v **CreateWorkflowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateWorkflowOutput if *v == nil { sv = &CreateWorkflowOutput{} } else { sv = *v } for key, value := range shape { switch key { case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeAccessOutput(v **DescribeAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAccessOutput if *v == nil { sv = &DescribeAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Access": if err := awsAwsjson11_deserializeDocumentDescribedAccess(&sv.Access, value); err != nil { return err } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeAgreementOutput(v **DescribeAgreementOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAgreementOutput if *v == nil { sv = &DescribeAgreementOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Agreement": if err := awsAwsjson11_deserializeDocumentDescribedAgreement(&sv.Agreement, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeCertificateOutput(v **DescribeCertificateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeCertificateOutput if *v == nil { sv = &DescribeCertificateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Certificate": if err := awsAwsjson11_deserializeDocumentDescribedCertificate(&sv.Certificate, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeConnectorOutput(v **DescribeConnectorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeConnectorOutput if *v == nil { sv = &DescribeConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connector": if err := awsAwsjson11_deserializeDocumentDescribedConnector(&sv.Connector, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeExecutionOutput(v **DescribeExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeExecutionOutput if *v == nil { sv = &DescribeExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Execution": if err := awsAwsjson11_deserializeDocumentDescribedExecution(&sv.Execution, value); err != nil { return err } case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeHostKeyOutput(v **DescribeHostKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeHostKeyOutput if *v == nil { sv = &DescribeHostKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HostKey": if err := awsAwsjson11_deserializeDocumentDescribedHostKey(&sv.HostKey, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeProfileOutput(v **DescribeProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeProfileOutput if *v == nil { sv = &DescribeProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Profile": if err := awsAwsjson11_deserializeDocumentDescribedProfile(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeSecurityPolicyOutput(v **DescribeSecurityPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSecurityPolicyOutput if *v == nil { sv = &DescribeSecurityPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityPolicy": if err := awsAwsjson11_deserializeDocumentDescribedSecurityPolicy(&sv.SecurityPolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeServerOutput(v **DescribeServerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeServerOutput if *v == nil { sv = &DescribeServerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Server": if err := awsAwsjson11_deserializeDocumentDescribedServer(&sv.Server, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeUserOutput(v **DescribeUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeUserOutput if *v == nil { sv = &DescribeUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "User": if err := awsAwsjson11_deserializeDocumentDescribedUser(&sv.User, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeWorkflowOutput(v **DescribeWorkflowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorkflowOutput if *v == nil { sv = &DescribeWorkflowOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Workflow": if err := awsAwsjson11_deserializeDocumentDescribedWorkflow(&sv.Workflow, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportCertificateOutput(v **ImportCertificateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportCertificateOutput if *v == nil { sv = &ImportCertificateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } sv.CertificateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportHostKeyOutput(v **ImportHostKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportHostKeyOutput if *v == nil { sv = &ImportHostKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HostKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyId to be of type string, got %T instead", value) } sv.HostKeyId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportSshPublicKeyOutput(v **ImportSshPublicKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportSshPublicKeyOutput if *v == nil { sv = &ImportSshPublicKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "SshPublicKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SshPublicKeyId to be of type string, got %T instead", value) } sv.SshPublicKeyId = ptr.String(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAccessesOutput(v **ListAccessesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAccessesOutput if *v == nil { sv = &ListAccessesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Accesses": if err := awsAwsjson11_deserializeDocumentListedAccesses(&sv.Accesses, 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) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAgreementsOutput(v **ListAgreementsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAgreementsOutput if *v == nil { sv = &ListAgreementsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Agreements": if err := awsAwsjson11_deserializeDocumentListedAgreements(&sv.Agreements, 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_deserializeOpDocumentListCertificatesOutput(v **ListCertificatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListCertificatesOutput if *v == nil { sv = &ListCertificatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Certificates": if err := awsAwsjson11_deserializeDocumentListedCertificates(&sv.Certificates, 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_deserializeOpDocumentListConnectorsOutput(v **ListConnectorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListConnectorsOutput if *v == nil { sv = &ListConnectorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connectors": if err := awsAwsjson11_deserializeDocumentListedConnectors(&sv.Connectors, 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_deserializeOpDocumentListExecutionsOutput(v **ListExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListExecutionsOutput if *v == nil { sv = &ListExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Executions": if err := awsAwsjson11_deserializeDocumentListedExecutions(&sv.Executions, 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) } case "WorkflowId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowId to be of type string, got %T instead", value) } sv.WorkflowId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListHostKeysOutput(v **ListHostKeysOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListHostKeysOutput if *v == nil { sv = &ListHostKeysOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HostKeys": if err := awsAwsjson11_deserializeDocumentListedHostKeys(&sv.HostKeys, 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) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListProfilesOutput if *v == nil { sv = &ListProfilesOutput{} } 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 "Profiles": if err := awsAwsjson11_deserializeDocumentListedProfiles(&sv.Profiles, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListSecurityPoliciesOutput(v **ListSecurityPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSecurityPoliciesOutput if *v == nil { sv = &ListSecurityPoliciesOutput{} } 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 "SecurityPolicyNames": if err := awsAwsjson11_deserializeDocumentSecurityPolicyNames(&sv.SecurityPolicyNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListServersOutput(v **ListServersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListServersOutput if *v == nil { sv = &ListServersOutput{} } 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 "Servers": if err := awsAwsjson11_deserializeDocumentListedServers(&sv.Servers, 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 "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } 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_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListUsersOutput if *v == nil { sv = &ListUsersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "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 "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "Users": if err := awsAwsjson11_deserializeDocumentListedUsers(&sv.Users, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListWorkflowsOutput(v **ListWorkflowsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorkflowsOutput if *v == nil { sv = &ListWorkflowsOutput{} } 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 "Workflows": if err := awsAwsjson11_deserializeDocumentListedWorkflows(&sv.Workflows, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentSendWorkflowStepStateOutput(v **SendWorkflowStepStateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SendWorkflowStepStateOutput if *v == nil { sv = &SendWorkflowStepStateOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartFileTransferOutput(v **StartFileTransferOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartFileTransferOutput if *v == nil { sv = &StartFileTransferOutput{} } else { sv = *v } for key, value := range shape { switch key { case "TransferId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TransferId to be of type string, got %T instead", value) } sv.TransferId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTestIdentityProviderOutput(v **TestIdentityProviderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TestIdentityProviderOutput if *v == nil { sv = &TestIdentityProviderOutput{} } 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 Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Response": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Response to be of type string, got %T instead", value) } sv.Response = ptr.String(jtv) } case "StatusCode": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StatusCode = int32(i64) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Url to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateAccessOutput(v **UpdateAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAccessOutput if *v == nil { sv = &UpdateAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ExternalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } sv.ExternalId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateAgreementOutput(v **UpdateAgreementOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAgreementOutput if *v == nil { sv = &UpdateAgreementOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AgreementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AgreementId to be of type string, got %T instead", value) } sv.AgreementId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateCertificateOutput(v **UpdateCertificateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateCertificateOutput if *v == nil { sv = &UpdateCertificateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } sv.CertificateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateConnectorOutput(v **UpdateConnectorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateConnectorOutput if *v == nil { sv = &UpdateConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ConnectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorId to be of type string, got %T instead", value) } sv.ConnectorId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateHostKeyOutput(v **UpdateHostKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateHostKeyOutput if *v == nil { sv = &UpdateHostKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HostKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostKeyId to be of type string, got %T instead", value) } sv.HostKeyId = ptr.String(jtv) } case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateProfileOutput if *v == nil { sv = &UpdateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileId to be of type string, got %T instead", value) } sv.ProfileId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateServerOutput(v **UpdateServerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateServerOutput if *v == nil { sv = &UpdateServerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateUserOutput(v **UpdateUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateUserOutput if *v == nil { sv = &UpdateUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
14,000
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package transfer provides the API client, operations, and parameter types for // AWS Transfer Family. // // Transfer Family is a fully managed service that enables the transfer of files // over the File Transfer Protocol (FTP), File Transfer Protocol over SSL (FTPS), // or Secure Shell (SSH) File Transfer Protocol (SFTP) directly into and out of // Amazon Simple Storage Service (Amazon S3) or Amazon EFS. Additionally, you can // use Applicability Statement 2 (AS2) to transfer files into and out of Amazon S3. // Amazon Web Services helps you seamlessly migrate your file transfer workflows to // Transfer Family by integrating with existing authentication systems, and // providing DNS routing with Amazon Route 53 so nothing changes for your customers // and partners, or their applications. With your data in Amazon S3, you can use it // with Amazon Web Services for processing, analytics, machine learning, and // archiving. Getting started with Transfer Family is easy since there is no // infrastructure to buy and set up. package transfer
19
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer 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/transfer/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 = "transfer" } 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 transfer // goModuleVersion is the tagged release for this module const goModuleVersion = "1.31.0"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/transfer/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpCreateAccess struct { } func (*awsAwsjson11_serializeOpCreateAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAccessInput) _ = 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("TransferService.CreateAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateAccessInput(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_serializeOpCreateAgreement struct { } func (*awsAwsjson11_serializeOpCreateAgreement) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateAgreement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAgreementInput) _ = 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("TransferService.CreateAgreement") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateAgreementInput(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_serializeOpCreateConnector struct { } func (*awsAwsjson11_serializeOpCreateConnector) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateConnectorInput) _ = 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("TransferService.CreateConnector") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateConnectorInput(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_serializeOpCreateProfile struct { } func (*awsAwsjson11_serializeOpCreateProfile) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProfileInput) _ = 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("TransferService.CreateProfile") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateProfileInput(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_serializeOpCreateServer struct { } func (*awsAwsjson11_serializeOpCreateServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateServerInput) _ = 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("TransferService.CreateServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateServerInput(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_serializeOpCreateUser struct { } func (*awsAwsjson11_serializeOpCreateUser) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.CreateUser") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateWorkflow struct { } func (*awsAwsjson11_serializeOpCreateWorkflow) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateWorkflow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateWorkflowInput) _ = 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("TransferService.CreateWorkflow") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateWorkflowInput(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_serializeOpDeleteAccess struct { } func (*awsAwsjson11_serializeOpDeleteAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAccessInput) _ = 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("TransferService.DeleteAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAccessInput(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_serializeOpDeleteAgreement struct { } func (*awsAwsjson11_serializeOpDeleteAgreement) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteAgreement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAgreementInput) _ = 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("TransferService.DeleteAgreement") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAgreementInput(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_serializeOpDeleteCertificate struct { } func (*awsAwsjson11_serializeOpDeleteCertificate) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteCertificateInput) _ = 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("TransferService.DeleteCertificate") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteCertificateInput(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_serializeOpDeleteConnector struct { } func (*awsAwsjson11_serializeOpDeleteConnector) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteConnectorInput) _ = 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("TransferService.DeleteConnector") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteConnectorInput(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_serializeOpDeleteHostKey struct { } func (*awsAwsjson11_serializeOpDeleteHostKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteHostKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteHostKeyInput) _ = 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("TransferService.DeleteHostKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteHostKeyInput(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_serializeOpDeleteProfile struct { } func (*awsAwsjson11_serializeOpDeleteProfile) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteProfileInput) _ = 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("TransferService.DeleteProfile") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteProfileInput(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_serializeOpDeleteServer struct { } func (*awsAwsjson11_serializeOpDeleteServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteServerInput) _ = 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("TransferService.DeleteServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteServerInput(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_serializeOpDeleteSshPublicKey struct { } func (*awsAwsjson11_serializeOpDeleteSshPublicKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteSshPublicKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteSshPublicKeyInput) _ = 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("TransferService.DeleteSshPublicKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteSshPublicKeyInput(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_serializeOpDeleteUser struct { } func (*awsAwsjson11_serializeOpDeleteUser) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.DeleteUser") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteUserInput(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_serializeOpDeleteWorkflow struct { } func (*awsAwsjson11_serializeOpDeleteWorkflow) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteWorkflow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteWorkflowInput) _ = 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("TransferService.DeleteWorkflow") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteWorkflowInput(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_serializeOpDescribeAccess struct { } func (*awsAwsjson11_serializeOpDescribeAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeAccessInput) _ = 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("TransferService.DescribeAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeAccessInput(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_serializeOpDescribeAgreement struct { } func (*awsAwsjson11_serializeOpDescribeAgreement) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeAgreement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeAgreementInput) _ = 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("TransferService.DescribeAgreement") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeAgreementInput(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_serializeOpDescribeCertificate struct { } func (*awsAwsjson11_serializeOpDescribeCertificate) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeCertificateInput) _ = 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("TransferService.DescribeCertificate") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeCertificateInput(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_serializeOpDescribeConnector struct { } func (*awsAwsjson11_serializeOpDescribeConnector) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeConnectorInput) _ = 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("TransferService.DescribeConnector") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeConnectorInput(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_serializeOpDescribeExecution struct { } func (*awsAwsjson11_serializeOpDescribeExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeExecutionInput) _ = 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("TransferService.DescribeExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeExecutionInput(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_serializeOpDescribeHostKey struct { } func (*awsAwsjson11_serializeOpDescribeHostKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeHostKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeHostKeyInput) _ = 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("TransferService.DescribeHostKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeHostKeyInput(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_serializeOpDescribeProfile struct { } func (*awsAwsjson11_serializeOpDescribeProfile) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeProfileInput) _ = 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("TransferService.DescribeProfile") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeProfileInput(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_serializeOpDescribeSecurityPolicy struct { } func (*awsAwsjson11_serializeOpDescribeSecurityPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeSecurityPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSecurityPolicyInput) _ = 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("TransferService.DescribeSecurityPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeSecurityPolicyInput(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_serializeOpDescribeServer struct { } func (*awsAwsjson11_serializeOpDescribeServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeServerInput) _ = 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("TransferService.DescribeServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeServerInput(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_serializeOpDescribeUser struct { } func (*awsAwsjson11_serializeOpDescribeUser) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.DescribeUser") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeUserInput(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_serializeOpDescribeWorkflow struct { } func (*awsAwsjson11_serializeOpDescribeWorkflow) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeWorkflow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorkflowInput) _ = 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("TransferService.DescribeWorkflow") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeWorkflowInput(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_serializeOpImportCertificate struct { } func (*awsAwsjson11_serializeOpImportCertificate) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportCertificateInput) _ = 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("TransferService.ImportCertificate") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportCertificateInput(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_serializeOpImportHostKey struct { } func (*awsAwsjson11_serializeOpImportHostKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportHostKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportHostKeyInput) _ = 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("TransferService.ImportHostKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportHostKeyInput(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_serializeOpImportSshPublicKey struct { } func (*awsAwsjson11_serializeOpImportSshPublicKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportSshPublicKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportSshPublicKeyInput) _ = 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("TransferService.ImportSshPublicKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportSshPublicKeyInput(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_serializeOpListAccesses struct { } func (*awsAwsjson11_serializeOpListAccesses) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAccesses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAccessesInput) _ = 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("TransferService.ListAccesses") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAccessesInput(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_serializeOpListAgreements struct { } func (*awsAwsjson11_serializeOpListAgreements) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAgreements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAgreementsInput) _ = 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("TransferService.ListAgreements") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAgreementsInput(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_serializeOpListCertificates struct { } func (*awsAwsjson11_serializeOpListCertificates) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListCertificatesInput) _ = 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("TransferService.ListCertificates") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListCertificatesInput(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_serializeOpListConnectors struct { } func (*awsAwsjson11_serializeOpListConnectors) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListConnectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListConnectorsInput) _ = 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("TransferService.ListConnectors") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListConnectorsInput(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_serializeOpListExecutions struct { } func (*awsAwsjson11_serializeOpListExecutions) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListExecutionsInput) _ = 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("TransferService.ListExecutions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListExecutionsInput(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_serializeOpListHostKeys struct { } func (*awsAwsjson11_serializeOpListHostKeys) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListHostKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListHostKeysInput) _ = 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("TransferService.ListHostKeys") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListHostKeysInput(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_serializeOpListProfiles struct { } func (*awsAwsjson11_serializeOpListProfiles) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProfilesInput) _ = 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("TransferService.ListProfiles") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListProfilesInput(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_serializeOpListSecurityPolicies struct { } func (*awsAwsjson11_serializeOpListSecurityPolicies) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListSecurityPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSecurityPoliciesInput) _ = 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("TransferService.ListSecurityPolicies") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListSecurityPoliciesInput(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_serializeOpListServers struct { } func (*awsAwsjson11_serializeOpListServers) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListServers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.ListServers") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListServersInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = 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("TransferService.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_serializeOpListUsers struct { } func (*awsAwsjson11_serializeOpListUsers) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListUsersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.ListUsers") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListUsersInput(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_serializeOpListWorkflows struct { } func (*awsAwsjson11_serializeOpListWorkflows) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListWorkflows) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorkflowsInput) _ = 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("TransferService.ListWorkflows") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListWorkflowsInput(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_serializeOpSendWorkflowStepState struct { } func (*awsAwsjson11_serializeOpSendWorkflowStepState) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpSendWorkflowStepState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*SendWorkflowStepStateInput) _ = 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("TransferService.SendWorkflowStepState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentSendWorkflowStepStateInput(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_serializeOpStartFileTransfer struct { } func (*awsAwsjson11_serializeOpStartFileTransfer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartFileTransfer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartFileTransferInput) _ = 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("TransferService.StartFileTransfer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartFileTransferInput(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_serializeOpStartServer struct { } func (*awsAwsjson11_serializeOpStartServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartServerInput) _ = 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("TransferService.StartServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartServerInput(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_serializeOpStopServer struct { } func (*awsAwsjson11_serializeOpStopServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStopServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopServerInput) _ = 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("TransferService.StopServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStopServerInput(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("TransferService.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_serializeOpTestIdentityProvider struct { } func (*awsAwsjson11_serializeOpTestIdentityProvider) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTestIdentityProvider) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TestIdentityProviderInput) _ = 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("TransferService.TestIdentityProvider") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTestIdentityProviderInput(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("TransferService.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_serializeOpUpdateAccess struct { } func (*awsAwsjson11_serializeOpUpdateAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateAccessInput) _ = 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("TransferService.UpdateAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateAccessInput(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_serializeOpUpdateAgreement struct { } func (*awsAwsjson11_serializeOpUpdateAgreement) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateAgreement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateAgreementInput) _ = 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("TransferService.UpdateAgreement") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateAgreementInput(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_serializeOpUpdateCertificate struct { } func (*awsAwsjson11_serializeOpUpdateCertificate) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateCertificateInput) _ = 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("TransferService.UpdateCertificate") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateCertificateInput(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_serializeOpUpdateConnector struct { } func (*awsAwsjson11_serializeOpUpdateConnector) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateConnectorInput) _ = 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("TransferService.UpdateConnector") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateConnectorInput(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_serializeOpUpdateHostKey struct { } func (*awsAwsjson11_serializeOpUpdateHostKey) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateHostKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateHostKeyInput) _ = 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("TransferService.UpdateHostKey") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateHostKeyInput(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_serializeOpUpdateProfile struct { } func (*awsAwsjson11_serializeOpUpdateProfile) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateProfileInput) _ = 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("TransferService.UpdateProfile") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateProfileInput(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_serializeOpUpdateServer struct { } func (*awsAwsjson11_serializeOpUpdateServer) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateServerInput) _ = 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("TransferService.UpdateServer") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateServerInput(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_serializeOpUpdateUser struct { } func (*awsAwsjson11_serializeOpUpdateUser) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("TransferService.UpdateUser") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson11_serializeDocumentAddressAllocationIds(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_serializeDocumentAs2ConnectorConfig(v *types.As2ConnectorConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BasicAuthSecretId != nil { ok := object.Key("BasicAuthSecretId") ok.String(*v.BasicAuthSecretId) } if len(v.Compression) > 0 { ok := object.Key("Compression") ok.String(string(v.Compression)) } if len(v.EncryptionAlgorithm) > 0 { ok := object.Key("EncryptionAlgorithm") ok.String(string(v.EncryptionAlgorithm)) } if v.LocalProfileId != nil { ok := object.Key("LocalProfileId") ok.String(*v.LocalProfileId) } if len(v.MdnResponse) > 0 { ok := object.Key("MdnResponse") ok.String(string(v.MdnResponse)) } if len(v.MdnSigningAlgorithm) > 0 { ok := object.Key("MdnSigningAlgorithm") ok.String(string(v.MdnSigningAlgorithm)) } if v.MessageSubject != nil { ok := object.Key("MessageSubject") ok.String(*v.MessageSubject) } if v.PartnerProfileId != nil { ok := object.Key("PartnerProfileId") ok.String(*v.PartnerProfileId) } if len(v.SigningAlgorithm) > 0 { ok := object.Key("SigningAlgorithm") ok.String(string(v.SigningAlgorithm)) } return nil } func awsAwsjson11_serializeDocumentAs2Transports(v []types.As2Transport, 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_serializeDocumentCertificateIds(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_serializeDocumentCopyStepDetails(v *types.CopyStepDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DestinationFileLocation != nil { ok := object.Key("DestinationFileLocation") if err := awsAwsjson11_serializeDocumentInputFileLocation(v.DestinationFileLocation, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if len(v.OverwriteExisting) > 0 { ok := object.Key("OverwriteExisting") ok.String(string(v.OverwriteExisting)) } if v.SourceFileLocation != nil { ok := object.Key("SourceFileLocation") ok.String(*v.SourceFileLocation) } return nil } func awsAwsjson11_serializeDocumentCustomStepDetails(v *types.CustomStepDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.SourceFileLocation != nil { ok := object.Key("SourceFileLocation") ok.String(*v.SourceFileLocation) } if v.Target != nil { ok := object.Key("Target") ok.String(*v.Target) } if v.TimeoutSeconds != nil { ok := object.Key("TimeoutSeconds") ok.Integer(*v.TimeoutSeconds) } return nil } func awsAwsjson11_serializeDocumentDecryptStepDetails(v *types.DecryptStepDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DestinationFileLocation != nil { ok := object.Key("DestinationFileLocation") if err := awsAwsjson11_serializeDocumentInputFileLocation(v.DestinationFileLocation, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if len(v.OverwriteExisting) > 0 { ok := object.Key("OverwriteExisting") ok.String(string(v.OverwriteExisting)) } if v.SourceFileLocation != nil { ok := object.Key("SourceFileLocation") ok.String(*v.SourceFileLocation) } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil } func awsAwsjson11_serializeDocumentDeleteStepDetails(v *types.DeleteStepDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.SourceFileLocation != nil { ok := object.Key("SourceFileLocation") ok.String(*v.SourceFileLocation) } return nil } func awsAwsjson11_serializeDocumentEfsFileLocation(v *types.EfsFileLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FileSystemId != nil { ok := object.Key("FileSystemId") ok.String(*v.FileSystemId) } if v.Path != nil { ok := object.Key("Path") ok.String(*v.Path) } return nil } func awsAwsjson11_serializeDocumentEndpointDetails(v *types.EndpointDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AddressAllocationIds != nil { ok := object.Key("AddressAllocationIds") if err := awsAwsjson11_serializeDocumentAddressAllocationIds(v.AddressAllocationIds, ok); err != nil { return err } } if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsAwsjson11_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("SubnetIds") if err := awsAwsjson11_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil { return err } } if v.VpcEndpointId != nil { ok := object.Key("VpcEndpointId") ok.String(*v.VpcEndpointId) } if v.VpcId != nil { ok := object.Key("VpcId") ok.String(*v.VpcId) } return nil } func awsAwsjson11_serializeDocumentFilePaths(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_serializeDocumentHomeDirectoryMapEntry(v *types.HomeDirectoryMapEntry, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Entry != nil { ok := object.Key("Entry") ok.String(*v.Entry) } if v.Target != nil { ok := object.Key("Target") ok.String(*v.Target) } return nil } func awsAwsjson11_serializeDocumentHomeDirectoryMappings(v []types.HomeDirectoryMapEntry, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentHomeDirectoryMapEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentIdentityProviderDetails(v *types.IdentityProviderDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DirectoryId != nil { ok := object.Key("DirectoryId") ok.String(*v.DirectoryId) } if v.Function != nil { ok := object.Key("Function") ok.String(*v.Function) } if v.InvocationRole != nil { ok := object.Key("InvocationRole") ok.String(*v.InvocationRole) } if len(v.SftpAuthenticationMethods) > 0 { ok := object.Key("SftpAuthenticationMethods") ok.String(string(v.SftpAuthenticationMethods)) } if v.Url != nil { ok := object.Key("Url") ok.String(*v.Url) } return nil } func awsAwsjson11_serializeDocumentInputFileLocation(v *types.InputFileLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EfsFileLocation != nil { ok := object.Key("EfsFileLocation") if err := awsAwsjson11_serializeDocumentEfsFileLocation(v.EfsFileLocation, ok); err != nil { return err } } if v.S3FileLocation != nil { ok := object.Key("S3FileLocation") if err := awsAwsjson11_serializeDocumentS3InputFileLocation(v.S3FileLocation, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentOnPartialUploadWorkflowDetails(v []types.WorkflowDetail, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentWorkflowDetail(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentOnUploadWorkflowDetails(v []types.WorkflowDetail, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentWorkflowDetail(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentPosixProfile(v *types.PosixProfile, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Gid != nil { ok := object.Key("Gid") ok.Long(*v.Gid) } if v.SecondaryGids != nil { ok := object.Key("SecondaryGids") if err := awsAwsjson11_serializeDocumentSecondaryGids(v.SecondaryGids, ok); err != nil { return err } } if v.Uid != nil { ok := object.Key("Uid") ok.Long(*v.Uid) } return nil } func awsAwsjson11_serializeDocumentProtocolDetails(v *types.ProtocolDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.As2Transports != nil { ok := object.Key("As2Transports") if err := awsAwsjson11_serializeDocumentAs2Transports(v.As2Transports, ok); err != nil { return err } } if v.PassiveIp != nil { ok := object.Key("PassiveIp") ok.String(*v.PassiveIp) } if len(v.SetStatOption) > 0 { ok := object.Key("SetStatOption") ok.String(string(v.SetStatOption)) } if len(v.TlsSessionResumptionMode) > 0 { ok := object.Key("TlsSessionResumptionMode") ok.String(string(v.TlsSessionResumptionMode)) } return nil } func awsAwsjson11_serializeDocumentProtocols(v []types.Protocol, 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_serializeDocumentS3InputFileLocation(v *types.S3InputFileLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("Bucket") ok.String(*v.Bucket) } if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } return nil } func awsAwsjson11_serializeDocumentS3Tag(v *types.S3Tag, 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_serializeDocumentS3Tags(v []types.S3Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentS3Tag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentSecondaryGids(v []int64, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.Long(v[i]) } return nil } func awsAwsjson11_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 awsAwsjson11_serializeDocumentStructuredLogDestinations(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_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 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_serializeDocumentTagStepDetails(v *types.TagStepDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.SourceFileLocation != nil { ok := object.Key("SourceFileLocation") ok.String(*v.SourceFileLocation) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentS3Tags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentWorkflowDetail(v *types.WorkflowDetail, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExecutionRole != nil { ok := object.Key("ExecutionRole") ok.String(*v.ExecutionRole) } if v.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeDocumentWorkflowDetails(v *types.WorkflowDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OnPartialUpload != nil { ok := object.Key("OnPartialUpload") if err := awsAwsjson11_serializeDocumentOnPartialUploadWorkflowDetails(v.OnPartialUpload, ok); err != nil { return err } } if v.OnUpload != nil { ok := object.Key("OnUpload") if err := awsAwsjson11_serializeDocumentOnUploadWorkflowDetails(v.OnUpload, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentWorkflowStep(v *types.WorkflowStep, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CopyStepDetails != nil { ok := object.Key("CopyStepDetails") if err := awsAwsjson11_serializeDocumentCopyStepDetails(v.CopyStepDetails, ok); err != nil { return err } } if v.CustomStepDetails != nil { ok := object.Key("CustomStepDetails") if err := awsAwsjson11_serializeDocumentCustomStepDetails(v.CustomStepDetails, ok); err != nil { return err } } if v.DecryptStepDetails != nil { ok := object.Key("DecryptStepDetails") if err := awsAwsjson11_serializeDocumentDecryptStepDetails(v.DecryptStepDetails, ok); err != nil { return err } } if v.DeleteStepDetails != nil { ok := object.Key("DeleteStepDetails") if err := awsAwsjson11_serializeDocumentDeleteStepDetails(v.DeleteStepDetails, ok); err != nil { return err } } if v.TagStepDetails != nil { ok := object.Key("TagStepDetails") if err := awsAwsjson11_serializeDocumentTagStepDetails(v.TagStepDetails, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil } func awsAwsjson11_serializeDocumentWorkflowSteps(v []types.WorkflowStep, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentWorkflowStep(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateAccessInput(v *CreateAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExternalId != nil { ok := object.Key("ExternalId") ok.String(*v.ExternalId) } if v.HomeDirectory != nil { ok := object.Key("HomeDirectory") ok.String(*v.HomeDirectory) } if v.HomeDirectoryMappings != nil { ok := object.Key("HomeDirectoryMappings") if err := awsAwsjson11_serializeDocumentHomeDirectoryMappings(v.HomeDirectoryMappings, ok); err != nil { return err } } if len(v.HomeDirectoryType) > 0 { ok := object.Key("HomeDirectoryType") ok.String(string(v.HomeDirectoryType)) } if v.Policy != nil { ok := object.Key("Policy") ok.String(*v.Policy) } if v.PosixProfile != nil { ok := object.Key("PosixProfile") if err := awsAwsjson11_serializeDocumentPosixProfile(v.PosixProfile, ok); err != nil { return err } } if v.Role != nil { ok := object.Key("Role") ok.String(*v.Role) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentCreateAgreementInput(v *CreateAgreementInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessRole != nil { ok := object.Key("AccessRole") ok.String(*v.AccessRole) } if v.BaseDirectory != nil { ok := object.Key("BaseDirectory") ok.String(*v.BaseDirectory) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.LocalProfileId != nil { ok := object.Key("LocalProfileId") ok.String(*v.LocalProfileId) } if v.PartnerProfileId != nil { ok := object.Key("PartnerProfileId") ok.String(*v.PartnerProfileId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateConnectorInput(v *CreateConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessRole != nil { ok := object.Key("AccessRole") ok.String(*v.AccessRole) } if v.As2Config != nil { ok := object.Key("As2Config") if err := awsAwsjson11_serializeDocumentAs2ConnectorConfig(v.As2Config, ok); err != nil { return err } } if v.LoggingRole != nil { ok := object.Key("LoggingRole") ok.String(*v.LoggingRole) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if v.Url != nil { ok := object.Key("Url") ok.String(*v.Url) } return nil } func awsAwsjson11_serializeOpDocumentCreateProfileInput(v *CreateProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.As2Id != nil { ok := object.Key("As2Id") ok.String(*v.As2Id) } if v.CertificateIds != nil { ok := object.Key("CertificateIds") if err := awsAwsjson11_serializeDocumentCertificateIds(v.CertificateIds, ok); err != nil { return err } } if len(v.ProfileType) > 0 { ok := object.Key("ProfileType") ok.String(string(v.ProfileType)) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateServerInput(v *CreateServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Certificate != nil { ok := object.Key("Certificate") ok.String(*v.Certificate) } if len(v.Domain) > 0 { ok := object.Key("Domain") ok.String(string(v.Domain)) } if v.EndpointDetails != nil { ok := object.Key("EndpointDetails") if err := awsAwsjson11_serializeDocumentEndpointDetails(v.EndpointDetails, ok); err != nil { return err } } if len(v.EndpointType) > 0 { ok := object.Key("EndpointType") ok.String(string(v.EndpointType)) } if v.HostKey != nil { ok := object.Key("HostKey") ok.String(*v.HostKey) } if v.IdentityProviderDetails != nil { ok := object.Key("IdentityProviderDetails") if err := awsAwsjson11_serializeDocumentIdentityProviderDetails(v.IdentityProviderDetails, ok); err != nil { return err } } if len(v.IdentityProviderType) > 0 { ok := object.Key("IdentityProviderType") ok.String(string(v.IdentityProviderType)) } if v.LoggingRole != nil { ok := object.Key("LoggingRole") ok.String(*v.LoggingRole) } if v.PostAuthenticationLoginBanner != nil { ok := object.Key("PostAuthenticationLoginBanner") ok.String(*v.PostAuthenticationLoginBanner) } if v.PreAuthenticationLoginBanner != nil { ok := object.Key("PreAuthenticationLoginBanner") ok.String(*v.PreAuthenticationLoginBanner) } if v.ProtocolDetails != nil { ok := object.Key("ProtocolDetails") if err := awsAwsjson11_serializeDocumentProtocolDetails(v.ProtocolDetails, ok); err != nil { return err } } if v.Protocols != nil { ok := object.Key("Protocols") if err := awsAwsjson11_serializeDocumentProtocols(v.Protocols, ok); err != nil { return err } } if v.SecurityPolicyName != nil { ok := object.Key("SecurityPolicyName") ok.String(*v.SecurityPolicyName) } if v.StructuredLogDestinations != nil { ok := object.Key("StructuredLogDestinations") if err := awsAwsjson11_serializeDocumentStructuredLogDestinations(v.StructuredLogDestinations, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if v.WorkflowDetails != nil { ok := object.Key("WorkflowDetails") if err := awsAwsjson11_serializeDocumentWorkflowDetails(v.WorkflowDetails, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateUserInput(v *CreateUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HomeDirectory != nil { ok := object.Key("HomeDirectory") ok.String(*v.HomeDirectory) } if v.HomeDirectoryMappings != nil { ok := object.Key("HomeDirectoryMappings") if err := awsAwsjson11_serializeDocumentHomeDirectoryMappings(v.HomeDirectoryMappings, ok); err != nil { return err } } if len(v.HomeDirectoryType) > 0 { ok := object.Key("HomeDirectoryType") ok.String(string(v.HomeDirectoryType)) } if v.Policy != nil { ok := object.Key("Policy") ok.String(*v.Policy) } if v.PosixProfile != nil { ok := object.Key("PosixProfile") if err := awsAwsjson11_serializeDocumentPosixProfile(v.PosixProfile, ok); err != nil { return err } } if v.Role != nil { ok := object.Key("Role") ok.String(*v.Role) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.SshPublicKeyBody != nil { ok := object.Key("SshPublicKeyBody") ok.String(*v.SshPublicKeyBody) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil } func awsAwsjson11_serializeOpDocumentCreateWorkflowInput(v *CreateWorkflowInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.OnExceptionSteps != nil { ok := object.Key("OnExceptionSteps") if err := awsAwsjson11_serializeDocumentWorkflowSteps(v.OnExceptionSteps, ok); err != nil { return err } } if v.Steps != nil { ok := object.Key("Steps") if err := awsAwsjson11_serializeDocumentWorkflowSteps(v.Steps, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDeleteAccessInput(v *DeleteAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExternalId != nil { ok := object.Key("ExternalId") ok.String(*v.ExternalId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteAgreementInput(v *DeleteAgreementInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AgreementId != nil { ok := object.Key("AgreementId") ok.String(*v.AgreementId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteCertificateInput(v *DeleteCertificateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CertificateId != nil { ok := object.Key("CertificateId") ok.String(*v.CertificateId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteConnectorInput(v *DeleteConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectorId != nil { ok := object.Key("ConnectorId") ok.String(*v.ConnectorId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteHostKeyInput(v *DeleteHostKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HostKeyId != nil { ok := object.Key("HostKeyId") ok.String(*v.HostKeyId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteProfileInput(v *DeleteProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProfileId != nil { ok := object.Key("ProfileId") ok.String(*v.ProfileId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteServerInput(v *DeleteServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteSshPublicKeyInput(v *DeleteSshPublicKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.SshPublicKeyId != nil { ok := object.Key("SshPublicKeyId") ok.String(*v.SshPublicKeyId) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil } func awsAwsjson11_serializeOpDocumentDeleteUserInput(v *DeleteUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil } func awsAwsjson11_serializeOpDocumentDeleteWorkflowInput(v *DeleteWorkflowInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeAccessInput(v *DescribeAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExternalId != nil { ok := object.Key("ExternalId") ok.String(*v.ExternalId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeAgreementInput(v *DescribeAgreementInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AgreementId != nil { ok := object.Key("AgreementId") ok.String(*v.AgreementId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeCertificateInput(v *DescribeCertificateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CertificateId != nil { ok := object.Key("CertificateId") ok.String(*v.CertificateId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeConnectorInput(v *DescribeConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectorId != nil { ok := object.Key("ConnectorId") ok.String(*v.ConnectorId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeExecutionInput(v *DescribeExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExecutionId != nil { ok := object.Key("ExecutionId") ok.String(*v.ExecutionId) } if v.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeHostKeyInput(v *DescribeHostKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HostKeyId != nil { ok := object.Key("HostKeyId") ok.String(*v.HostKeyId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeProfileInput(v *DescribeProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProfileId != nil { ok := object.Key("ProfileId") ok.String(*v.ProfileId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeSecurityPolicyInput(v *DescribeSecurityPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityPolicyName != nil { ok := object.Key("SecurityPolicyName") ok.String(*v.SecurityPolicyName) } return nil } func awsAwsjson11_serializeOpDocumentDescribeServerInput(v *DescribeServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeUserInput(v *DescribeUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil } func awsAwsjson11_serializeOpDocumentDescribeWorkflowInput(v *DescribeWorkflowInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeOpDocumentImportCertificateInput(v *ImportCertificateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActiveDate != nil { ok := object.Key("ActiveDate") ok.Double(smithytime.FormatEpochSeconds(*v.ActiveDate)) } if v.Certificate != nil { ok := object.Key("Certificate") ok.String(*v.Certificate) } if v.CertificateChain != nil { ok := object.Key("CertificateChain") ok.String(*v.CertificateChain) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.InactiveDate != nil { ok := object.Key("InactiveDate") ok.Double(smithytime.FormatEpochSeconds(*v.InactiveDate)) } if v.PrivateKey != nil { ok := object.Key("PrivateKey") ok.String(*v.PrivateKey) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if len(v.Usage) > 0 { ok := object.Key("Usage") ok.String(string(v.Usage)) } return nil } func awsAwsjson11_serializeOpDocumentImportHostKeyInput(v *ImportHostKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.HostKeyBody != nil { ok := object.Key("HostKeyBody") ok.String(*v.HostKeyBody) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentImportSshPublicKeyInput(v *ImportSshPublicKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.SshPublicKeyBody != nil { ok := object.Key("SshPublicKeyBody") ok.String(*v.SshPublicKeyBody) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil } func awsAwsjson11_serializeOpDocumentListAccessesInput(v *ListAccessesInput, 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.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentListAgreementsInput(v *ListAgreementsInput, 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.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentListCertificatesInput(v *ListCertificatesInput, 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_serializeOpDocumentListConnectorsInput(v *ListConnectorsInput, 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_serializeOpDocumentListExecutionsInput(v *ListExecutionsInput, 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.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeOpDocumentListHostKeysInput(v *ListHostKeysInput, 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.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentListProfilesInput(v *ListProfilesInput, 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 len(v.ProfileType) > 0 { ok := object.Key("ProfileType") ok.String(string(v.ProfileType)) } return nil } func awsAwsjson11_serializeOpDocumentListSecurityPoliciesInput(v *ListSecurityPoliciesInput, 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_serializeOpDocumentListServersInput(v *ListServersInput, 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.Arn != nil { ok := object.Key("Arn") ok.String(*v.Arn) } 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_serializeOpDocumentListUsersInput(v *ListUsersInput, 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.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentListWorkflowsInput(v *ListWorkflowsInput, 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_serializeOpDocumentSendWorkflowStepStateInput(v *SendWorkflowStepStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExecutionId != nil { ok := object.Key("ExecutionId") ok.String(*v.ExecutionId) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } if v.Token != nil { ok := object.Key("Token") ok.String(*v.Token) } if v.WorkflowId != nil { ok := object.Key("WorkflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson11_serializeOpDocumentStartFileTransferInput(v *StartFileTransferInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectorId != nil { ok := object.Key("ConnectorId") ok.String(*v.ConnectorId) } if v.SendFilePaths != nil { ok := object.Key("SendFilePaths") if err := awsAwsjson11_serializeDocumentFilePaths(v.SendFilePaths, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStartServerInput(v *StartServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentStopServerInput(v *StopServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Arn != nil { ok := object.Key("Arn") ok.String(*v.Arn) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentTestIdentityProviderInput(v *TestIdentityProviderInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if len(v.ServerProtocol) > 0 { ok := object.Key("ServerProtocol") ok.String(string(v.ServerProtocol)) } if v.SourceIp != nil { ok := object.Key("SourceIp") ok.String(*v.SourceIp) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } if v.UserPassword != nil { ok := object.Key("UserPassword") ok.String(*v.UserPassword) } return nil } func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Arn != nil { ok := object.Key("Arn") ok.String(*v.Arn) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsAwsjson11_serializeDocumentTagKeys(v.TagKeys, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateAccessInput(v *UpdateAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExternalId != nil { ok := object.Key("ExternalId") ok.String(*v.ExternalId) } if v.HomeDirectory != nil { ok := object.Key("HomeDirectory") ok.String(*v.HomeDirectory) } if v.HomeDirectoryMappings != nil { ok := object.Key("HomeDirectoryMappings") if err := awsAwsjson11_serializeDocumentHomeDirectoryMappings(v.HomeDirectoryMappings, ok); err != nil { return err } } if len(v.HomeDirectoryType) > 0 { ok := object.Key("HomeDirectoryType") ok.String(string(v.HomeDirectoryType)) } if v.Policy != nil { ok := object.Key("Policy") ok.String(*v.Policy) } if v.PosixProfile != nil { ok := object.Key("PosixProfile") if err := awsAwsjson11_serializeDocumentPosixProfile(v.PosixProfile, ok); err != nil { return err } } if v.Role != nil { ok := object.Key("Role") ok.String(*v.Role) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateAgreementInput(v *UpdateAgreementInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessRole != nil { ok := object.Key("AccessRole") ok.String(*v.AccessRole) } if v.AgreementId != nil { ok := object.Key("AgreementId") ok.String(*v.AgreementId) } if v.BaseDirectory != nil { ok := object.Key("BaseDirectory") ok.String(*v.BaseDirectory) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.LocalProfileId != nil { ok := object.Key("LocalProfileId") ok.String(*v.LocalProfileId) } if v.PartnerProfileId != nil { ok := object.Key("PartnerProfileId") ok.String(*v.PartnerProfileId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } return nil } func awsAwsjson11_serializeOpDocumentUpdateCertificateInput(v *UpdateCertificateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActiveDate != nil { ok := object.Key("ActiveDate") ok.Double(smithytime.FormatEpochSeconds(*v.ActiveDate)) } if v.CertificateId != nil { ok := object.Key("CertificateId") ok.String(*v.CertificateId) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.InactiveDate != nil { ok := object.Key("InactiveDate") ok.Double(smithytime.FormatEpochSeconds(*v.InactiveDate)) } return nil } func awsAwsjson11_serializeOpDocumentUpdateConnectorInput(v *UpdateConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessRole != nil { ok := object.Key("AccessRole") ok.String(*v.AccessRole) } if v.As2Config != nil { ok := object.Key("As2Config") if err := awsAwsjson11_serializeDocumentAs2ConnectorConfig(v.As2Config, ok); err != nil { return err } } if v.ConnectorId != nil { ok := object.Key("ConnectorId") ok.String(*v.ConnectorId) } if v.LoggingRole != nil { ok := object.Key("LoggingRole") ok.String(*v.LoggingRole) } if v.Url != nil { ok := object.Key("Url") ok.String(*v.Url) } return nil } func awsAwsjson11_serializeOpDocumentUpdateHostKeyInput(v *UpdateHostKeyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.HostKeyId != nil { ok := object.Key("HostKeyId") ok.String(*v.HostKeyId) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateProfileInput(v *UpdateProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CertificateIds != nil { ok := object.Key("CertificateIds") if err := awsAwsjson11_serializeDocumentCertificateIds(v.CertificateIds, ok); err != nil { return err } } if v.ProfileId != nil { ok := object.Key("ProfileId") ok.String(*v.ProfileId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateServerInput(v *UpdateServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Certificate != nil { ok := object.Key("Certificate") ok.String(*v.Certificate) } if v.EndpointDetails != nil { ok := object.Key("EndpointDetails") if err := awsAwsjson11_serializeDocumentEndpointDetails(v.EndpointDetails, ok); err != nil { return err } } if len(v.EndpointType) > 0 { ok := object.Key("EndpointType") ok.String(string(v.EndpointType)) } if v.HostKey != nil { ok := object.Key("HostKey") ok.String(*v.HostKey) } if v.IdentityProviderDetails != nil { ok := object.Key("IdentityProviderDetails") if err := awsAwsjson11_serializeDocumentIdentityProviderDetails(v.IdentityProviderDetails, ok); err != nil { return err } } if v.LoggingRole != nil { ok := object.Key("LoggingRole") ok.String(*v.LoggingRole) } if v.PostAuthenticationLoginBanner != nil { ok := object.Key("PostAuthenticationLoginBanner") ok.String(*v.PostAuthenticationLoginBanner) } if v.PreAuthenticationLoginBanner != nil { ok := object.Key("PreAuthenticationLoginBanner") ok.String(*v.PreAuthenticationLoginBanner) } if v.ProtocolDetails != nil { ok := object.Key("ProtocolDetails") if err := awsAwsjson11_serializeDocumentProtocolDetails(v.ProtocolDetails, ok); err != nil { return err } } if v.Protocols != nil { ok := object.Key("Protocols") if err := awsAwsjson11_serializeDocumentProtocols(v.Protocols, ok); err != nil { return err } } if v.SecurityPolicyName != nil { ok := object.Key("SecurityPolicyName") ok.String(*v.SecurityPolicyName) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.StructuredLogDestinations != nil { ok := object.Key("StructuredLogDestinations") if err := awsAwsjson11_serializeDocumentStructuredLogDestinations(v.StructuredLogDestinations, ok); err != nil { return err } } if v.WorkflowDetails != nil { ok := object.Key("WorkflowDetails") if err := awsAwsjson11_serializeDocumentWorkflowDetails(v.WorkflowDetails, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateUserInput(v *UpdateUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HomeDirectory != nil { ok := object.Key("HomeDirectory") ok.String(*v.HomeDirectory) } if v.HomeDirectoryMappings != nil { ok := object.Key("HomeDirectoryMappings") if err := awsAwsjson11_serializeDocumentHomeDirectoryMappings(v.HomeDirectoryMappings, ok); err != nil { return err } } if len(v.HomeDirectoryType) > 0 { ok := object.Key("HomeDirectoryType") ok.String(string(v.HomeDirectoryType)) } if v.Policy != nil { ok := object.Key("Policy") ok.String(*v.Policy) } if v.PosixProfile != nil { ok := object.Key("PosixProfile") if err := awsAwsjson11_serializeDocumentPosixProfile(v.PosixProfile, ok); err != nil { return err } } if v.Role != nil { ok := object.Key("Role") ok.String(*v.Role) } if v.ServerId != nil { ok := object.Key("ServerId") ok.String(*v.ServerId) } if v.UserName != nil { ok := object.Key("UserName") ok.String(*v.UserName) } return nil }
5,382
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package transfer import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/transfer/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateAccess struct { } func (*validateOpCreateAccess) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateAgreement struct { } func (*validateOpCreateAgreement) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAgreement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAgreementInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAgreementInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateConnector struct { } func (*validateOpCreateConnector) ID() string { return "OperationInputValidation" } func (m *validateOpCreateConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateProfile struct { } func (*validateOpCreateProfile) ID() string { return "OperationInputValidation" } func (m *validateOpCreateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateServer struct { } func (*validateOpCreateServer) ID() string { return "OperationInputValidation" } func (m *validateOpCreateServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateUser struct { } func (*validateOpCreateUser) ID() string { return "OperationInputValidation" } func (m *validateOpCreateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorkflow struct { } func (*validateOpCreateWorkflow) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorkflow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorkflowInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorkflowInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAccess struct { } func (*validateOpDeleteAccess) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAgreement struct { } func (*validateOpDeleteAgreement) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAgreement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAgreementInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAgreementInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCertificate struct { } func (*validateOpDeleteCertificate) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCertificateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCertificateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteConnector struct { } func (*validateOpDeleteConnector) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteHostKey struct { } func (*validateOpDeleteHostKey) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteHostKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteHostKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteHostKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteProfile struct { } func (*validateOpDeleteProfile) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteServer struct { } func (*validateOpDeleteServer) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSshPublicKey struct { } func (*validateOpDeleteSshPublicKey) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSshPublicKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSshPublicKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSshPublicKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteUser struct { } func (*validateOpDeleteUser) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteWorkflow struct { } func (*validateOpDeleteWorkflow) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteWorkflow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteWorkflowInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteWorkflowInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeAccess struct { } func (*validateOpDescribeAccess) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeAgreement struct { } func (*validateOpDescribeAgreement) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeAgreement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeAgreementInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeAgreementInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeCertificate struct { } func (*validateOpDescribeCertificate) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeCertificateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeCertificateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConnector struct { } func (*validateOpDescribeConnector) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeExecution struct { } func (*validateOpDescribeExecution) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeHostKey struct { } func (*validateOpDescribeHostKey) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeHostKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeHostKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeHostKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeProfile struct { } func (*validateOpDescribeProfile) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSecurityPolicy struct { } func (*validateOpDescribeSecurityPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSecurityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSecurityPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeServer struct { } func (*validateOpDescribeServer) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeUser struct { } func (*validateOpDescribeUser) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorkflow struct { } func (*validateOpDescribeWorkflow) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorkflow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorkflowInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorkflowInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportCertificate struct { } func (*validateOpImportCertificate) ID() string { return "OperationInputValidation" } func (m *validateOpImportCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportCertificateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportCertificateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportHostKey struct { } func (*validateOpImportHostKey) ID() string { return "OperationInputValidation" } func (m *validateOpImportHostKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportHostKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportHostKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportSshPublicKey struct { } func (*validateOpImportSshPublicKey) ID() string { return "OperationInputValidation" } func (m *validateOpImportSshPublicKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportSshPublicKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportSshPublicKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAccesses struct { } func (*validateOpListAccesses) ID() string { return "OperationInputValidation" } func (m *validateOpListAccesses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAccessesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAccessesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAgreements struct { } func (*validateOpListAgreements) ID() string { return "OperationInputValidation" } func (m *validateOpListAgreements) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAgreementsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAgreementsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListExecutions struct { } func (*validateOpListExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpListExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListExecutionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListHostKeys struct { } func (*validateOpListHostKeys) ID() string { return "OperationInputValidation" } func (m *validateOpListHostKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListHostKeysInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListHostKeysInput(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 validateOpListUsers struct { } func (*validateOpListUsers) ID() string { return "OperationInputValidation" } func (m *validateOpListUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListUsersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListUsersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSendWorkflowStepState struct { } func (*validateOpSendWorkflowStepState) ID() string { return "OperationInputValidation" } func (m *validateOpSendWorkflowStepState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SendWorkflowStepStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSendWorkflowStepStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartFileTransfer struct { } func (*validateOpStartFileTransfer) ID() string { return "OperationInputValidation" } func (m *validateOpStartFileTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartFileTransferInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartFileTransferInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartServer struct { } func (*validateOpStartServer) ID() string { return "OperationInputValidation" } func (m *validateOpStartServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopServer struct { } func (*validateOpStopServer) ID() string { return "OperationInputValidation" } func (m *validateOpStopServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopServerInput(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 validateOpTestIdentityProvider struct { } func (*validateOpTestIdentityProvider) ID() string { return "OperationInputValidation" } func (m *validateOpTestIdentityProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TestIdentityProviderInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTestIdentityProviderInput(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 validateOpUpdateAccess struct { } func (*validateOpUpdateAccess) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateAgreement struct { } func (*validateOpUpdateAgreement) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateAgreement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateAgreementInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateAgreementInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateCertificate struct { } func (*validateOpUpdateCertificate) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateCertificateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateCertificateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateConnector struct { } func (*validateOpUpdateConnector) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateHostKey struct { } func (*validateOpUpdateHostKey) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateHostKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateHostKeyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateHostKeyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateProfile struct { } func (*validateOpUpdateProfile) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateServer struct { } func (*validateOpUpdateServer) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateUser struct { } func (*validateOpUpdateUser) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccess{}, middleware.After) } func addOpCreateAgreementValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAgreement{}, middleware.After) } func addOpCreateConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateConnector{}, middleware.After) } func addOpCreateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProfile{}, middleware.After) } func addOpCreateServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateServer{}, middleware.After) } func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After) } func addOpCreateWorkflowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkflow{}, middleware.After) } func addOpDeleteAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAccess{}, middleware.After) } func addOpDeleteAgreementValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAgreement{}, middleware.After) } func addOpDeleteCertificateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCertificate{}, middleware.After) } func addOpDeleteConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteConnector{}, middleware.After) } func addOpDeleteHostKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteHostKey{}, middleware.After) } func addOpDeleteProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProfile{}, middleware.After) } func addOpDeleteServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteServer{}, middleware.After) } func addOpDeleteSshPublicKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSshPublicKey{}, middleware.After) } func addOpDeleteUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteUser{}, middleware.After) } func addOpDeleteWorkflowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkflow{}, middleware.After) } func addOpDescribeAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAccess{}, middleware.After) } func addOpDescribeAgreementValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAgreement{}, middleware.After) } func addOpDescribeCertificateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCertificate{}, middleware.After) } func addOpDescribeConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConnector{}, middleware.After) } func addOpDescribeExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeExecution{}, middleware.After) } func addOpDescribeHostKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeHostKey{}, middleware.After) } func addOpDescribeProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeProfile{}, middleware.After) } func addOpDescribeSecurityPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSecurityPolicy{}, middleware.After) } func addOpDescribeServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeServer{}, middleware.After) } func addOpDescribeUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeUser{}, middleware.After) } func addOpDescribeWorkflowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkflow{}, middleware.After) } func addOpImportCertificateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportCertificate{}, middleware.After) } func addOpImportHostKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportHostKey{}, middleware.After) } func addOpImportSshPublicKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportSshPublicKey{}, middleware.After) } func addOpListAccessesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccesses{}, middleware.After) } func addOpListAgreementsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAgreements{}, middleware.After) } func addOpListExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListExecutions{}, middleware.After) } func addOpListHostKeysValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListHostKeys{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpListUsersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListUsers{}, middleware.After) } func addOpSendWorkflowStepStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendWorkflowStepState{}, middleware.After) } func addOpStartFileTransferValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartFileTransfer{}, middleware.After) } func addOpStartServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartServer{}, middleware.After) } func addOpStopServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopServer{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpTestIdentityProviderValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTestIdentityProvider{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAccess{}, middleware.After) } func addOpUpdateAgreementValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAgreement{}, middleware.After) } func addOpUpdateCertificateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCertificate{}, middleware.After) } func addOpUpdateConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConnector{}, middleware.After) } func addOpUpdateHostKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateHostKey{}, middleware.After) } func addOpUpdateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProfile{}, middleware.After) } func addOpUpdateServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateServer{}, middleware.After) } func addOpUpdateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateUser{}, middleware.After) } func validateDecryptStepDetails(v *types.DecryptStepDetails) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DecryptStepDetails"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.DestinationFileLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("DestinationFileLocation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateHomeDirectoryMapEntry(v *types.HomeDirectoryMapEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HomeDirectoryMapEntry"} if v.Entry == nil { invalidParams.Add(smithy.NewErrParamRequired("Entry")) } if v.Target == nil { invalidParams.Add(smithy.NewErrParamRequired("Target")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateHomeDirectoryMappings(v []types.HomeDirectoryMapEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HomeDirectoryMappings"} for i := range v { if err := validateHomeDirectoryMapEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOnPartialUploadWorkflowDetails(v []types.WorkflowDetail) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OnPartialUploadWorkflowDetails"} for i := range v { if err := validateWorkflowDetail(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOnUploadWorkflowDetails(v []types.WorkflowDetail) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OnUploadWorkflowDetails"} for i := range v { if err := validateWorkflowDetail(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePosixProfile(v *types.PosixProfile) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PosixProfile"} if v.Uid == nil { invalidParams.Add(smithy.NewErrParamRequired("Uid")) } if v.Gid == nil { invalidParams.Add(smithy.NewErrParamRequired("Gid")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Tag(v *types.S3Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Tag"} 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 validateS3Tags(v []types.S3Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Tags"} for i := range v { if err := validateS3Tag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func 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 validateTagStepDetails(v *types.TagStepDetails) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagStepDetails"} if v.Tags != nil { if err := validateS3Tags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowDetail(v *types.WorkflowDetail) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowDetail"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.ExecutionRole == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionRole")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowDetails(v *types.WorkflowDetails) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowDetails"} if v.OnUpload != nil { if err := validateOnUploadWorkflowDetails(v.OnUpload); err != nil { invalidParams.AddNested("OnUpload", err.(smithy.InvalidParamsError)) } } if v.OnPartialUpload != nil { if err := validateOnPartialUploadWorkflowDetails(v.OnPartialUpload); err != nil { invalidParams.AddNested("OnPartialUpload", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowStep(v *types.WorkflowStep) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowStep"} if v.TagStepDetails != nil { if err := validateTagStepDetails(v.TagStepDetails); err != nil { invalidParams.AddNested("TagStepDetails", err.(smithy.InvalidParamsError)) } } if v.DecryptStepDetails != nil { if err := validateDecryptStepDetails(v.DecryptStepDetails); err != nil { invalidParams.AddNested("DecryptStepDetails", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowSteps(v []types.WorkflowStep) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowSteps"} for i := range v { if err := validateWorkflowStep(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAccessInput(v *CreateAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAccessInput"} if v.HomeDirectoryMappings != nil { if err := validateHomeDirectoryMappings(v.HomeDirectoryMappings); err != nil { invalidParams.AddNested("HomeDirectoryMappings", err.(smithy.InvalidParamsError)) } } if v.PosixProfile != nil { if err := validatePosixProfile(v.PosixProfile); err != nil { invalidParams.AddNested("PosixProfile", err.(smithy.InvalidParamsError)) } } if v.Role == nil { invalidParams.Add(smithy.NewErrParamRequired("Role")) } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.ExternalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExternalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAgreementInput(v *CreateAgreementInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAgreementInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.LocalProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("LocalProfileId")) } if v.PartnerProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("PartnerProfileId")) } if v.BaseDirectory == nil { invalidParams.Add(smithy.NewErrParamRequired("BaseDirectory")) } if v.AccessRole == nil { invalidParams.Add(smithy.NewErrParamRequired("AccessRole")) } 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 validateOpCreateConnectorInput(v *CreateConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateConnectorInput"} if v.Url == nil { invalidParams.Add(smithy.NewErrParamRequired("Url")) } if v.As2Config == nil { invalidParams.Add(smithy.NewErrParamRequired("As2Config")) } if v.AccessRole == nil { invalidParams.Add(smithy.NewErrParamRequired("AccessRole")) } 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 validateOpCreateProfileInput(v *CreateProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateProfileInput"} if v.As2Id == nil { invalidParams.Add(smithy.NewErrParamRequired("As2Id")) } if len(v.ProfileType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ProfileType")) } 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 validateOpCreateServerInput(v *CreateServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateServerInput"} if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if v.WorkflowDetails != nil { if err := validateWorkflowDetails(v.WorkflowDetails); err != nil { invalidParams.AddNested("WorkflowDetails", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateUserInput(v *CreateUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateUserInput"} if v.HomeDirectoryMappings != nil { if err := validateHomeDirectoryMappings(v.HomeDirectoryMappings); err != nil { invalidParams.AddNested("HomeDirectoryMappings", err.(smithy.InvalidParamsError)) } } if v.PosixProfile != nil { if err := validatePosixProfile(v.PosixProfile); err != nil { invalidParams.AddNested("PosixProfile", err.(smithy.InvalidParamsError)) } } if v.Role == nil { invalidParams.Add(smithy.NewErrParamRequired("Role")) } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorkflowInput(v *CreateWorkflowInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorkflowInput"} if v.Steps == nil { invalidParams.Add(smithy.NewErrParamRequired("Steps")) } else if v.Steps != nil { if err := validateWorkflowSteps(v.Steps); err != nil { invalidParams.AddNested("Steps", err.(smithy.InvalidParamsError)) } } if v.OnExceptionSteps != nil { if err := validateWorkflowSteps(v.OnExceptionSteps); err != nil { invalidParams.AddNested("OnExceptionSteps", 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 validateOpDeleteAccessInput(v *DeleteAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.ExternalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExternalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAgreementInput(v *DeleteAgreementInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAgreementInput"} if v.AgreementId == nil { invalidParams.Add(smithy.NewErrParamRequired("AgreementId")) } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCertificateInput(v *DeleteCertificateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCertificateInput"} if v.CertificateId == nil { invalidParams.Add(smithy.NewErrParamRequired("CertificateId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteConnectorInput(v *DeleteConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteConnectorInput"} if v.ConnectorId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteHostKeyInput(v *DeleteHostKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteHostKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.HostKeyId == nil { invalidParams.Add(smithy.NewErrParamRequired("HostKeyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteProfileInput(v *DeleteProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteServerInput(v *DeleteServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteServerInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSshPublicKeyInput(v *DeleteSshPublicKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSshPublicKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.SshPublicKeyId == nil { invalidParams.Add(smithy.NewErrParamRequired("SshPublicKeyId")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteUserInput(v *DeleteUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteUserInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteWorkflowInput(v *DeleteWorkflowInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkflowInput"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeAccessInput(v *DescribeAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeAccessInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.ExternalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExternalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeAgreementInput(v *DescribeAgreementInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeAgreementInput"} if v.AgreementId == nil { invalidParams.Add(smithy.NewErrParamRequired("AgreementId")) } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeCertificateInput(v *DescribeCertificateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeCertificateInput"} if v.CertificateId == nil { invalidParams.Add(smithy.NewErrParamRequired("CertificateId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConnectorInput(v *DescribeConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConnectorInput"} if v.ConnectorId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeExecutionInput(v *DescribeExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeExecutionInput"} if v.ExecutionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeHostKeyInput(v *DescribeHostKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeHostKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.HostKeyId == nil { invalidParams.Add(smithy.NewErrParamRequired("HostKeyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeProfileInput(v *DescribeProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSecurityPolicyInput(v *DescribeSecurityPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSecurityPolicyInput"} if v.SecurityPolicyName == nil { invalidParams.Add(smithy.NewErrParamRequired("SecurityPolicyName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeServerInput(v *DescribeServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeServerInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeUserInput(v *DescribeUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeUserInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorkflowInput(v *DescribeWorkflowInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorkflowInput"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpImportCertificateInput(v *ImportCertificateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportCertificateInput"} if len(v.Usage) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Usage")) } if v.Certificate == nil { invalidParams.Add(smithy.NewErrParamRequired("Certificate")) } 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 validateOpImportHostKeyInput(v *ImportHostKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportHostKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.HostKeyBody == nil { invalidParams.Add(smithy.NewErrParamRequired("HostKeyBody")) } 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 validateOpImportSshPublicKeyInput(v *ImportSshPublicKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportSshPublicKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.SshPublicKeyBody == nil { invalidParams.Add(smithy.NewErrParamRequired("SshPublicKeyBody")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAccessesInput(v *ListAccessesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAccessesInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAgreementsInput(v *ListAgreementsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAgreementsInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListExecutionsInput(v *ListExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListExecutionsInput"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListHostKeysInput(v *ListHostKeysInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListHostKeysInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } 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 validateOpListUsersInput(v *ListUsersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListUsersInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSendWorkflowStepStateInput(v *SendWorkflowStepStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendWorkflowStepStateInput"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.ExecutionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) } if v.Token == nil { invalidParams.Add(smithy.NewErrParamRequired("Token")) } if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartFileTransferInput(v *StartFileTransferInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartFileTransferInput"} if v.ConnectorId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorId")) } if v.SendFilePaths == nil { invalidParams.Add(smithy.NewErrParamRequired("SendFilePaths")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartServerInput(v *StartServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartServerInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopServerInput(v *StopServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopServerInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } 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 := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTestIdentityProviderInput(v *TestIdentityProviderInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TestIdentityProviderInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } 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 validateOpUpdateAccessInput(v *UpdateAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessInput"} if v.HomeDirectoryMappings != nil { if err := validateHomeDirectoryMappings(v.HomeDirectoryMappings); err != nil { invalidParams.AddNested("HomeDirectoryMappings", err.(smithy.InvalidParamsError)) } } if v.PosixProfile != nil { if err := validatePosixProfile(v.PosixProfile); err != nil { invalidParams.AddNested("PosixProfile", err.(smithy.InvalidParamsError)) } } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.ExternalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExternalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateAgreementInput(v *UpdateAgreementInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateAgreementInput"} if v.AgreementId == nil { invalidParams.Add(smithy.NewErrParamRequired("AgreementId")) } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateCertificateInput(v *UpdateCertificateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateCertificateInput"} if v.CertificateId == nil { invalidParams.Add(smithy.NewErrParamRequired("CertificateId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateConnectorInput(v *UpdateConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConnectorInput"} if v.ConnectorId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateHostKeyInput(v *UpdateHostKeyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateHostKeyInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.HostKeyId == nil { invalidParams.Add(smithy.NewErrParamRequired("HostKeyId")) } if v.Description == nil { invalidParams.Add(smithy.NewErrParamRequired("Description")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateProfileInput(v *UpdateProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateServerInput(v *UpdateServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateServerInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.WorkflowDetails != nil { if err := validateWorkflowDetails(v.WorkflowDetails); err != nil { invalidParams.AddNested("WorkflowDetails", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateUserInput(v *UpdateUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateUserInput"} if v.HomeDirectoryMappings != nil { if err := validateHomeDirectoryMappings(v.HomeDirectoryMappings); err != nil { invalidParams.AddNested("HomeDirectoryMappings", err.(smithy.InvalidParamsError)) } } if v.PosixProfile != nil { if err := validatePosixProfile(v.PosixProfile); err != nil { invalidParams.AddNested("PosixProfile", err.(smithy.InvalidParamsError)) } } if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.UserName == nil { invalidParams.Add(smithy.NewErrParamRequired("UserName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,525
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 Transfer 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: "transfer.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "transfer-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.ca-central-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ Hostname: "transfer-fips.ca-central-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ca-central-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "transfer.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "transfer-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{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: "transfer-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{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: "transfer-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{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: "transfer-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{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: "transfer.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "transfer-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "transfer.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips-us-gov-east-1", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-gov-west-1", }: endpoints.Endpoint{ Hostname: "transfer-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "transfer-fips.us-gov-west-1.amazonaws.com", }, }, }, }
498
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 AgreementStatusType string // Enum values for AgreementStatusType const ( AgreementStatusTypeActive AgreementStatusType = "ACTIVE" AgreementStatusTypeInactive AgreementStatusType = "INACTIVE" ) // Values returns all known values for AgreementStatusType. 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 (AgreementStatusType) Values() []AgreementStatusType { return []AgreementStatusType{ "ACTIVE", "INACTIVE", } } type As2Transport string // Enum values for As2Transport const ( As2TransportHttp As2Transport = "HTTP" ) // Values returns all known values for As2Transport. 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 (As2Transport) Values() []As2Transport { return []As2Transport{ "HTTP", } } type CertificateStatusType string // Enum values for CertificateStatusType const ( CertificateStatusTypeActive CertificateStatusType = "ACTIVE" CertificateStatusTypePendingRotation CertificateStatusType = "PENDING_ROTATION" CertificateStatusTypeInactive CertificateStatusType = "INACTIVE" ) // Values returns all known values for CertificateStatusType. 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 (CertificateStatusType) Values() []CertificateStatusType { return []CertificateStatusType{ "ACTIVE", "PENDING_ROTATION", "INACTIVE", } } type CertificateType string // Enum values for CertificateType const ( CertificateTypeCertificate CertificateType = "CERTIFICATE" CertificateTypeCertificateWithPrivateKey CertificateType = "CERTIFICATE_WITH_PRIVATE_KEY" ) // Values returns all known values for CertificateType. 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 (CertificateType) Values() []CertificateType { return []CertificateType{ "CERTIFICATE", "CERTIFICATE_WITH_PRIVATE_KEY", } } type CertificateUsageType string // Enum values for CertificateUsageType const ( CertificateUsageTypeSigning CertificateUsageType = "SIGNING" CertificateUsageTypeEncryption CertificateUsageType = "ENCRYPTION" ) // Values returns all known values for CertificateUsageType. 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 (CertificateUsageType) Values() []CertificateUsageType { return []CertificateUsageType{ "SIGNING", "ENCRYPTION", } } type CompressionEnum string // Enum values for CompressionEnum const ( CompressionEnumZlib CompressionEnum = "ZLIB" CompressionEnumDisabled CompressionEnum = "DISABLED" ) // Values returns all known values for CompressionEnum. 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 (CompressionEnum) Values() []CompressionEnum { return []CompressionEnum{ "ZLIB", "DISABLED", } } type CustomStepStatus string // Enum values for CustomStepStatus const ( CustomStepStatusSuccess CustomStepStatus = "SUCCESS" CustomStepStatusFailure CustomStepStatus = "FAILURE" ) // Values returns all known values for CustomStepStatus. 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 (CustomStepStatus) Values() []CustomStepStatus { return []CustomStepStatus{ "SUCCESS", "FAILURE", } } type Domain string // Enum values for Domain const ( DomainS3 Domain = "S3" DomainEfs Domain = "EFS" ) // Values returns all known values for Domain. 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 (Domain) Values() []Domain { return []Domain{ "S3", "EFS", } } type EncryptionAlg string // Enum values for EncryptionAlg const ( EncryptionAlgAes128Cbc EncryptionAlg = "AES128_CBC" EncryptionAlgAes192Cbc EncryptionAlg = "AES192_CBC" EncryptionAlgAes256Cbc EncryptionAlg = "AES256_CBC" EncryptionAlgNone EncryptionAlg = "NONE" ) // Values returns all known values for EncryptionAlg. 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 (EncryptionAlg) Values() []EncryptionAlg { return []EncryptionAlg{ "AES128_CBC", "AES192_CBC", "AES256_CBC", "NONE", } } type EncryptionType string // Enum values for EncryptionType const ( EncryptionTypePgp EncryptionType = "PGP" ) // Values returns all known values for EncryptionType. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (EncryptionType) Values() []EncryptionType { return []EncryptionType{ "PGP", } } type EndpointType string // Enum values for EndpointType const ( EndpointTypePublic EndpointType = "PUBLIC" EndpointTypeVpc EndpointType = "VPC" EndpointTypeVpcEndpoint EndpointType = "VPC_ENDPOINT" ) // Values returns all known values for EndpointType. 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 (EndpointType) Values() []EndpointType { return []EndpointType{ "PUBLIC", "VPC", "VPC_ENDPOINT", } } type ExecutionErrorType string // Enum values for ExecutionErrorType const ( ExecutionErrorTypePermissionDenied ExecutionErrorType = "PERMISSION_DENIED" ExecutionErrorTypeCustomStepFailed ExecutionErrorType = "CUSTOM_STEP_FAILED" ExecutionErrorTypeThrottled ExecutionErrorType = "THROTTLED" ExecutionErrorTypeAlreadyExists ExecutionErrorType = "ALREADY_EXISTS" ExecutionErrorTypeNotFound ExecutionErrorType = "NOT_FOUND" ExecutionErrorTypeBadRequest ExecutionErrorType = "BAD_REQUEST" ExecutionErrorTypeTimeout ExecutionErrorType = "TIMEOUT" ExecutionErrorTypeInternalServerError ExecutionErrorType = "INTERNAL_SERVER_ERROR" ) // Values returns all known values for ExecutionErrorType. 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 (ExecutionErrorType) Values() []ExecutionErrorType { return []ExecutionErrorType{ "PERMISSION_DENIED", "CUSTOM_STEP_FAILED", "THROTTLED", "ALREADY_EXISTS", "NOT_FOUND", "BAD_REQUEST", "TIMEOUT", "INTERNAL_SERVER_ERROR", } } type ExecutionStatus string // Enum values for ExecutionStatus const ( ExecutionStatusInProgress ExecutionStatus = "IN_PROGRESS" ExecutionStatusCompleted ExecutionStatus = "COMPLETED" ExecutionStatusException ExecutionStatus = "EXCEPTION" ExecutionStatusHandlingException ExecutionStatus = "HANDLING_EXCEPTION" ) // Values returns all known values for ExecutionStatus. 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 (ExecutionStatus) Values() []ExecutionStatus { return []ExecutionStatus{ "IN_PROGRESS", "COMPLETED", "EXCEPTION", "HANDLING_EXCEPTION", } } type HomeDirectoryType string // Enum values for HomeDirectoryType const ( HomeDirectoryTypePath HomeDirectoryType = "PATH" HomeDirectoryTypeLogical HomeDirectoryType = "LOGICAL" ) // Values returns all known values for HomeDirectoryType. 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 (HomeDirectoryType) Values() []HomeDirectoryType { return []HomeDirectoryType{ "PATH", "LOGICAL", } } type IdentityProviderType string // Enum values for IdentityProviderType const ( IdentityProviderTypeServiceManaged IdentityProviderType = "SERVICE_MANAGED" IdentityProviderTypeApiGateway IdentityProviderType = "API_GATEWAY" IdentityProviderTypeAwsDirectoryService IdentityProviderType = "AWS_DIRECTORY_SERVICE" IdentityProviderTypeAwsLambda IdentityProviderType = "AWS_LAMBDA" ) // Values returns all known values for IdentityProviderType. 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 (IdentityProviderType) Values() []IdentityProviderType { return []IdentityProviderType{ "SERVICE_MANAGED", "API_GATEWAY", "AWS_DIRECTORY_SERVICE", "AWS_LAMBDA", } } type MdnResponse string // Enum values for MdnResponse const ( MdnResponseSync MdnResponse = "SYNC" MdnResponseNone MdnResponse = "NONE" ) // Values returns all known values for MdnResponse. 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 (MdnResponse) Values() []MdnResponse { return []MdnResponse{ "SYNC", "NONE", } } type MdnSigningAlg string // Enum values for MdnSigningAlg const ( MdnSigningAlgSha256 MdnSigningAlg = "SHA256" MdnSigningAlgSha384 MdnSigningAlg = "SHA384" MdnSigningAlgSha512 MdnSigningAlg = "SHA512" MdnSigningAlgSha1 MdnSigningAlg = "SHA1" MdnSigningAlgNone MdnSigningAlg = "NONE" MdnSigningAlgDefault MdnSigningAlg = "DEFAULT" ) // Values returns all known values for MdnSigningAlg. 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 (MdnSigningAlg) Values() []MdnSigningAlg { return []MdnSigningAlg{ "SHA256", "SHA384", "SHA512", "SHA1", "NONE", "DEFAULT", } } type OverwriteExisting string // Enum values for OverwriteExisting const ( OverwriteExistingTrue OverwriteExisting = "TRUE" OverwriteExistingFalse OverwriteExisting = "FALSE" ) // Values returns all known values for OverwriteExisting. 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 (OverwriteExisting) Values() []OverwriteExisting { return []OverwriteExisting{ "TRUE", "FALSE", } } type ProfileType string // Enum values for ProfileType const ( ProfileTypeLocal ProfileType = "LOCAL" ProfileTypePartner ProfileType = "PARTNER" ) // Values returns all known values for ProfileType. 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 (ProfileType) Values() []ProfileType { return []ProfileType{ "LOCAL", "PARTNER", } } type Protocol string // Enum values for Protocol const ( ProtocolSftp Protocol = "SFTP" ProtocolFtp Protocol = "FTP" ProtocolFtps Protocol = "FTPS" ProtocolAs2 Protocol = "AS2" ) // Values returns all known values for Protocol. 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 (Protocol) Values() []Protocol { return []Protocol{ "SFTP", "FTP", "FTPS", "AS2", } } type SetStatOption string // Enum values for SetStatOption const ( SetStatOptionDefault SetStatOption = "DEFAULT" SetStatOptionEnableNoOp SetStatOption = "ENABLE_NO_OP" ) // Values returns all known values for SetStatOption. 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 (SetStatOption) Values() []SetStatOption { return []SetStatOption{ "DEFAULT", "ENABLE_NO_OP", } } type SftpAuthenticationMethods string // Enum values for SftpAuthenticationMethods const ( SftpAuthenticationMethodsPassword SftpAuthenticationMethods = "PASSWORD" SftpAuthenticationMethodsPublicKey SftpAuthenticationMethods = "PUBLIC_KEY" SftpAuthenticationMethodsPublicKeyOrPassword SftpAuthenticationMethods = "PUBLIC_KEY_OR_PASSWORD" SftpAuthenticationMethodsPublicKeyAndPassword SftpAuthenticationMethods = "PUBLIC_KEY_AND_PASSWORD" ) // Values returns all known values for SftpAuthenticationMethods. 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 (SftpAuthenticationMethods) Values() []SftpAuthenticationMethods { return []SftpAuthenticationMethods{ "PASSWORD", "PUBLIC_KEY", "PUBLIC_KEY_OR_PASSWORD", "PUBLIC_KEY_AND_PASSWORD", } } type SigningAlg string // Enum values for SigningAlg const ( SigningAlgSha256 SigningAlg = "SHA256" SigningAlgSha384 SigningAlg = "SHA384" SigningAlgSha512 SigningAlg = "SHA512" SigningAlgSha1 SigningAlg = "SHA1" SigningAlgNone SigningAlg = "NONE" ) // Values returns all known values for SigningAlg. 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 (SigningAlg) Values() []SigningAlg { return []SigningAlg{ "SHA256", "SHA384", "SHA512", "SHA1", "NONE", } } type State string // Enum values for State const ( StateOffline State = "OFFLINE" StateOnline State = "ONLINE" StateStarting State = "STARTING" StateStopping State = "STOPPING" StateStartFailed State = "START_FAILED" StateStopFailed State = "STOP_FAILED" ) // Values returns all known values for State. 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 (State) Values() []State { return []State{ "OFFLINE", "ONLINE", "STARTING", "STOPPING", "START_FAILED", "STOP_FAILED", } } type TlsSessionResumptionMode string // Enum values for TlsSessionResumptionMode const ( TlsSessionResumptionModeDisabled TlsSessionResumptionMode = "DISABLED" TlsSessionResumptionModeEnabled TlsSessionResumptionMode = "ENABLED" TlsSessionResumptionModeEnforced TlsSessionResumptionMode = "ENFORCED" ) // Values returns all known values for TlsSessionResumptionMode. 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 (TlsSessionResumptionMode) Values() []TlsSessionResumptionMode { return []TlsSessionResumptionMode{ "DISABLED", "ENABLED", "ENFORCED", } } type WorkflowStepType string // Enum values for WorkflowStepType const ( WorkflowStepTypeCopy WorkflowStepType = "COPY" WorkflowStepTypeCustom WorkflowStepType = "CUSTOM" WorkflowStepTypeTag WorkflowStepType = "TAG" WorkflowStepTypeDelete WorkflowStepType = "DELETE" WorkflowStepTypeDecrypt WorkflowStepType = "DECRYPT" ) // Values returns all known values for WorkflowStepType. 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 (WorkflowStepType) Values() []WorkflowStepType { return []WorkflowStepType{ "COPY", "CUSTOM", "TAG", "DELETE", "DECRYPT", } }
534
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 do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This exception is thrown when the UpdateServer is called for a file transfer // protocol-enabled server that has VPC as the endpoint type and the server's // VpcEndpointID is not in the available state. 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 } // This exception is thrown when an error occurs in the Amazon Web // ServicesTransfer Family service. type InternalServiceError struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServiceError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServiceError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServiceError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServiceError" } return *e.ErrorCodeOverride } func (e *InternalServiceError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The NextToken parameter that was passed is invalid. type InvalidNextTokenException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidNextTokenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidNextTokenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidNextTokenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidNextTokenException" } return *e.ErrorCodeOverride } func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This exception is thrown when the client submits a malformed request. type InvalidRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidRequestException" } return *e.ErrorCodeOverride } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested resource does not exist. type ResourceExistsException struct { Message *string ErrorCodeOverride *string Resource *string ResourceType *string noSmithyDocumentSerde } func (e *ResourceExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceExistsException" } return *e.ErrorCodeOverride } func (e *ResourceExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This exception is thrown when a resource is not found by the Amazon Web // ServicesTransfer Family service. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string Resource *string ResourceType *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request has failed because the Amazon Web ServicesTransfer Family service // is not available. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The request was denied due to request throttling. type ThrottlingException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds *string noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
256
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 the details for a connector object. The connector object is used for // AS2 outbound processes, to connect the Transfer Family customer with the trading // partner. type As2ConnectorConfig struct { // Provides Basic authentication support to the AS2 Connectors API. To use Basic // authentication, you must provide the name or Amazon Resource Name (ARN) of a // secret in Secrets Manager. The default value for this parameter is null , which // indicates that Basic authentication is not enabled for the connector. If the // connector should use Basic authentication, the secret needs to be in the // following format: { "Username": "user-name", "Password": "user-password" } // Replace user-name and user-password with the credentials for the actual user // that is being authenticated. Note the following: // - You are storing these credentials in Secrets Manager, not passing them // directly into this API. // - If you are using the API, SDKs, or CloudFormation to configure your // connector, then you must create the secret before you can enable Basic // authentication. However, if you are using the Amazon Web Services management // console, you can have the system create the secret for you. // If you have previously enabled Basic authentication for a connector, you can // disable it by using the UpdateConnector API call. For example, if you are using // the CLI, you can run the following command to remove Basic authentication: // update-connector --connector-id my-connector-id --as2-config // 'BasicAuthSecretId=""' BasicAuthSecretId *string // Specifies whether the AS2 file is compressed. Compression CompressionEnum // The algorithm that is used to encrypt the file. You can only specify NONE if // the URL for your connector uses HTTPS. This ensures that no traffic is sent in // clear text. EncryptionAlgorithm EncryptionAlg // A unique identifier for the AS2 local profile. LocalProfileId *string // Used for outbound requests (from an Transfer Family server to a partner AS2 // server) to determine whether the partner response for transfers is synchronous // or asynchronous. Specify either of the following values: // - SYNC : The system expects a synchronous MDN response, confirming that the // file was transferred successfully (or not). // - NONE : Specifies that no MDN response is required. MdnResponse MdnResponse // The signing algorithm for the MDN response. If set to DEFAULT (or not set at // all), the value for SigningAlgorithm is used. MdnSigningAlgorithm MdnSigningAlg // Used as the Subject HTTP header attribute in AS2 messages that are being sent // with the connector. MessageSubject *string // A unique identifier for the partner profile for the connector. PartnerProfileId *string // The algorithm that is used to sign the AS2 messages sent with the connector. SigningAlgorithm SigningAlg noSmithyDocumentSerde } // Each step type has its own StepDetails structure. type CopyStepDetails struct { // Specifies the location for the file being copied. Use ${Transfer:UserName} or // ${Transfer:UploadDate} in this field to parametrize the destination prefix by // username or uploaded date. // - Set the value of DestinationFileLocation to ${Transfer:UserName} to copy // uploaded files to an Amazon S3 bucket that is prefixed with the name of the // Transfer Family user that uploaded the file. // - Set the value of DestinationFileLocation to ${Transfer:UploadDate} to copy // uploaded files to an Amazon S3 bucket that is prefixed with the date of the // upload. The system resolves UploadDate to a date format of YYYY-MM-DD, based // on the date the file is uploaded in UTC. DestinationFileLocation *InputFileLocation // The name of the step, used as an identifier. Name *string // A flag that indicates whether to overwrite an existing file of the same name. // The default is FALSE . If the workflow is processing a file that has the same // name as an existing file, the behavior is as follows: // - If OverwriteExisting is TRUE , the existing file is replaced with the file // being processed. // - If OverwriteExisting is FALSE , nothing happens, and the workflow processing // stops. OverwriteExisting OverwriteExisting // Specifies which file to use as input to the workflow step: either the output // from the previous step, or the originally uploaded file for the workflow. // - To use the previous file as the input, enter ${previous.file} . In this // case, this workflow step uses the output file from the previous workflow step as // input. This is the default value. // - To use the originally uploaded file location as input for this step, enter // ${original.file} . SourceFileLocation *string noSmithyDocumentSerde } // Each step type has its own StepDetails structure. type CustomStepDetails struct { // The name of the step, used as an identifier. Name *string // Specifies which file to use as input to the workflow step: either the output // from the previous step, or the originally uploaded file for the workflow. // - To use the previous file as the input, enter ${previous.file} . In this // case, this workflow step uses the output file from the previous workflow step as // input. This is the default value. // - To use the originally uploaded file location as input for this step, enter // ${original.file} . SourceFileLocation *string // The ARN for the Lambda function that is being called. Target *string // Timeout, in seconds, for the step. TimeoutSeconds *int32 noSmithyDocumentSerde } // Each step type has its own StepDetails structure. type DecryptStepDetails struct { // Specifies the location for the file being decrypted. Use ${Transfer:UserName} // or ${Transfer:UploadDate} in this field to parametrize the destination prefix // by username or uploaded date. // - Set the value of DestinationFileLocation to ${Transfer:UserName} to decrypt // uploaded files to an Amazon S3 bucket that is prefixed with the name of the // Transfer Family user that uploaded the file. // - Set the value of DestinationFileLocation to ${Transfer:UploadDate} to // decrypt uploaded files to an Amazon S3 bucket that is prefixed with the date of // the upload. The system resolves UploadDate to a date format of YYYY-MM-DD, // based on the date the file is uploaded in UTC. // // This member is required. DestinationFileLocation *InputFileLocation // The type of encryption used. Currently, this value must be PGP . // // This member is required. Type EncryptionType // The name of the step, used as an identifier. Name *string // A flag that indicates whether to overwrite an existing file of the same name. // The default is FALSE . If the workflow is processing a file that has the same // name as an existing file, the behavior is as follows: // - If OverwriteExisting is TRUE , the existing file is replaced with the file // being processed. // - If OverwriteExisting is FALSE , nothing happens, and the workflow processing // stops. OverwriteExisting OverwriteExisting // Specifies which file to use as input to the workflow step: either the output // from the previous step, or the originally uploaded file for the workflow. // - To use the previous file as the input, enter ${previous.file} . In this // case, this workflow step uses the output file from the previous workflow step as // input. This is the default value. // - To use the originally uploaded file location as input for this step, enter // ${original.file} . SourceFileLocation *string noSmithyDocumentSerde } // The name of the step, used to identify the delete step. type DeleteStepDetails struct { // The name of the step, used as an identifier. Name *string // Specifies which file to use as input to the workflow step: either the output // from the previous step, or the originally uploaded file for the workflow. // - To use the previous file as the input, enter ${previous.file} . In this // case, this workflow step uses the output file from the previous workflow step as // input. This is the default value. // - To use the originally uploaded file location as input for this step, enter // ${original.file} . SourceFileLocation *string noSmithyDocumentSerde } // Describes the properties of the access that was specified. type DescribedAccess struct { // A unique identifier that is required to identify specific groups within your // directory. The users of the group that you associate have access to your Amazon // S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If // you know the group name, you can view the SID values by running the following // command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like // "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that // command, replace YourGroupName with the name of your Active Directory group. The // regular expression used to validate this parameter is a string of characters // consisting of uppercase and lowercase alphanumeric characters with no spaces. // You can also include underscores or any of the following characters: =,.@:/- ExternalId *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and // keys should be visible to your user and how you want to make them visible. You // must specify the Entry and Target pair, where Entry shows how the path is made // visible and Target is the actual Amazon S3 or Amazon EFS path. If you only // specify a target, it is displayed as is. You also must ensure that your Identity // and Access Management (IAM) role provides access to paths in Target . This value // can be set only when HomeDirectoryType is set to LOGICAL. In most cases, you // can use this value instead of the session policy to lock down the associated // access to the designated home directory (" chroot "). To do this, you can set // Entry to '/' and set Target to the HomeDirectory parameter value. HomeDirectoryMappings []HomeDirectoryMapEntry // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access // Management (IAM) role across multiple users. This policy scopes down a user's // access to portions of their Amazon S3 bucket. Variables that you can use inside // this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and // ${Transfer:HomeBucket} . Policy *string // The full POSIX identity, including user ID ( Uid ), group ID ( Gid ), and any // secondary groups IDs ( SecondaryGids ), that controls your users' access to your // Amazon EFS file systems. The POSIX permissions that are set on files and // directories in your file system determine the level of access your users get // when transferring files into and out of your Amazon EFS file systems. PosixProfile *PosixProfile // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. Role *string noSmithyDocumentSerde } // Describes the properties of an agreement. type DescribedAgreement struct { // The unique Amazon Resource Name (ARN) for the agreement. // // This member is required. Arn *string // With AS2, you can send files by calling StartFileTransfer and specifying the // file paths in the request parameter, SendFilePaths . We use the file’s parent // directory (for example, for --send-file-paths /bucket/dir/file.txt , parent // directory is /bucket/dir/ ) to temporarily store a processed AS2 message file, // store the MDN when we receive them from the partner, and write a final JSON file // containing relevant metadata of the transmission. So, the AccessRole needs to // provide read and write access to the parent directory of the file location used // in the StartFileTransfer request. Additionally, you need to provide read and // write access to the parent directory of the files that you intend to send with // StartFileTransfer . If you are using Basic authentication for your AS2 // connector, the access role requires the secretsmanager:GetSecretValue // permission for the secret. If the secret is encrypted using a customer-managed // key instead of the Amazon Web Services managed key in Secrets Manager, then the // role also needs the kms:Decrypt permission for that key. AccessRole *string // A unique identifier for the agreement. This identifier is returned when you // create an agreement. AgreementId *string // The landing directory (folder) for files that are transferred by using the AS2 // protocol. BaseDirectory *string // The name or short description that's used to identify the agreement. Description *string // A unique identifier for the AS2 local profile. LocalProfileId *string // A unique identifier for the partner profile used in the agreement. PartnerProfileId *string // A system-assigned unique identifier for a server instance. This identifier // indicates the specific server that the agreement uses. ServerId *string // The current status of the agreement, either ACTIVE or INACTIVE . Status AgreementStatusType // Key-value pairs that can be used to group and search for agreements. Tags []Tag noSmithyDocumentSerde } // Describes the properties of a certificate. type DescribedCertificate struct { // The unique Amazon Resource Name (ARN) for the certificate. // // This member is required. Arn *string // An optional date that specifies when the certificate becomes active. ActiveDate *time.Time // The file name for the certificate. Certificate *string // The list of certificates that make up the chain for the certificate. CertificateChain *string // An array of identifiers for the imported certificates. You use this identifier // for working with profiles and partner profiles. CertificateId *string // The name or description that's used to identity the certificate. Description *string // An optional date that specifies when the certificate becomes inactive. InactiveDate *time.Time // The final date that the certificate is valid. NotAfterDate *time.Time // The earliest date that the certificate is valid. NotBeforeDate *time.Time // The serial number for the certificate. Serial *string // The certificate can be either ACTIVE , PENDING_ROTATION , or INACTIVE . // PENDING_ROTATION means that this certificate will replace the current // certificate when it expires. Status CertificateStatusType // Key-value pairs that can be used to group and search for certificates. Tags []Tag // If a private key has been specified for the certificate, its type is // CERTIFICATE_WITH_PRIVATE_KEY . If there is no private key, the type is // CERTIFICATE . Type CertificateType // Specifies whether this certificate is used for signing or encryption. Usage CertificateUsageType noSmithyDocumentSerde } // Describes the parameters for the connector, as identified by the ConnectorId . type DescribedConnector struct { // The unique Amazon Resource Name (ARN) for the connector. // // This member is required. Arn *string // With AS2, you can send files by calling StartFileTransfer and specifying the // file paths in the request parameter, SendFilePaths . We use the file’s parent // directory (for example, for --send-file-paths /bucket/dir/file.txt , parent // directory is /bucket/dir/ ) to temporarily store a processed AS2 message file, // store the MDN when we receive them from the partner, and write a final JSON file // containing relevant metadata of the transmission. So, the AccessRole needs to // provide read and write access to the parent directory of the file location used // in the StartFileTransfer request. Additionally, you need to provide read and // write access to the parent directory of the files that you intend to send with // StartFileTransfer . If you are using Basic authentication for your AS2 // connector, the access role requires the secretsmanager:GetSecretValue // permission for the secret. If the secret is encrypted using a customer-managed // key instead of the Amazon Web Services managed key in Secrets Manager, then the // role also needs the kms:Decrypt permission for that key. AccessRole *string // A structure that contains the parameters for a connector object. As2Config *As2ConnectorConfig // The unique identifier for the connector. ConnectorId *string // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a connector to turn on CloudWatch logging for Amazon S3 events. When // set, you can view connector activity in your CloudWatch logs. LoggingRole *string // Key-value pairs that can be used to group and search for connectors. Tags []Tag // The URL of the partner's AS2 endpoint. Url *string noSmithyDocumentSerde } // The details for an execution object. type DescribedExecution struct { // A unique identifier for the execution of a workflow. ExecutionId *string // The IAM role associated with the execution. ExecutionRole *string // A structure that describes the Amazon S3 or EFS file location. This is the file // location when the execution begins: if the file is being copied, this is the // initial (as opposed to destination) file location. InitialFileLocation *FileLocation // The IAM logging role associated with the execution. LoggingConfiguration *LoggingConfiguration // The full POSIX identity, including user ID ( Uid ), group ID ( Gid ), and any // secondary groups IDs ( SecondaryGids ), that controls your users' access to your // Amazon EFS file systems. The POSIX permissions that are set on files and // directories in your file system determine the level of access your users get // when transferring files into and out of your Amazon EFS file systems. PosixProfile *PosixProfile // A structure that describes the execution results. This includes a list of the // steps along with the details of each step, error type and message (if any), and // the OnExceptionSteps structure. Results *ExecutionResults // A container object for the session details that are associated with a workflow. ServiceMetadata *ServiceMetadata // The status is one of the execution. Can be in progress, completed, exception // encountered, or handling the exception. Status ExecutionStatus noSmithyDocumentSerde } // The details for a server host key. type DescribedHostKey struct { // The unique Amazon Resource Name (ARN) for the host key. // // This member is required. Arn *string // The date on which the host key was added to the server. DateImported *time.Time // The text description for this host key. Description *string // The public key fingerprint, which is a short sequence of bytes used to identify // the longer public key. HostKeyFingerprint *string // A unique identifier for the host key. HostKeyId *string // Key-value pairs that can be used to group and search for host keys. Tags []Tag // The encryption algorithm that is used for the host key. The Type parameter is // specified by using one of the following values: // - ssh-rsa // - ssh-ed25519 // - ecdsa-sha2-nistp256 // - ecdsa-sha2-nistp384 // - ecdsa-sha2-nistp521 Type *string noSmithyDocumentSerde } // The details for a local or partner AS2 profile. type DescribedProfile struct { // The unique Amazon Resource Name (ARN) for the profile. // // This member is required. Arn *string // The As2Id is the AS2-name, as defined in the RFC 4130 (https://datatracker.ietf.org/doc/html/rfc4130) // . For inbound transfers, this is the AS2-From header for the AS2 messages sent // from the partner. For outbound connectors, this is the AS2-To header for the // AS2 messages sent to the partner using the StartFileTransfer API operation. // This ID cannot include spaces. As2Id *string // An array of identifiers for the imported certificates. You use this identifier // for working with profiles and partner profiles. CertificateIds []string // A unique identifier for the local or partner AS2 profile. ProfileId *string // Indicates whether to list only LOCAL type profiles or only PARTNER type // profiles. If not supplied in the request, the command lists all types of // profiles. ProfileType ProfileType // Key-value pairs that can be used to group and search for profiles. Tags []Tag noSmithyDocumentSerde } // Describes the properties of a security policy that was specified. For more // information about security policies, see Working with security policies (https://docs.aws.amazon.com/transfer/latest/userguide/security-policies.html) // . type DescribedSecurityPolicy struct { // Specifies the name of the security policy that is attached to the server. // // This member is required. SecurityPolicyName *string // Specifies whether this policy enables Federal Information Processing Standards // (FIPS). Fips *bool // Specifies the enabled Secure Shell (SSH) cipher encryption algorithms in the // security policy that is attached to the server. SshCiphers []string // Specifies the enabled SSH key exchange (KEX) encryption algorithms in the // security policy that is attached to the server. SshKexs []string // Specifies the enabled SSH message authentication code (MAC) encryption // algorithms in the security policy that is attached to the server. SshMacs []string // Specifies the enabled Transport Layer Security (TLS) cipher encryption // algorithms in the security policy that is attached to the server. TlsCiphers []string noSmithyDocumentSerde } // Describes the properties of a file transfer protocol-enabled server that was // specified. type DescribedServer struct { // Specifies the unique Amazon Resource Name (ARN) of the server. // // This member is required. Arn *string // Specifies the ARN of the Amazon Web ServicesCertificate Manager (ACM) // certificate. Required when Protocols is set to FTPS . Certificate *string // Specifies the domain of the storage system that is used for file transfers. Domain Domain // The virtual private cloud (VPC) endpoint settings that are configured for your // server. When you host your endpoint within your VPC, you can make your endpoint // accessible only to resources within your VPC, or you can attach Elastic IP // addresses and make your endpoint accessible to clients over the internet. Your // VPC's default security groups are automatically assigned to your endpoint. EndpointDetails *EndpointDetails // Defines the type of endpoint that your server is connected to. If your server // is connected to a VPC endpoint, your server isn't accessible over the public // internet. EndpointType EndpointType // Specifies the Base64-encoded SHA256 fingerprint of the server's host key. This // value is equivalent to the output of the ssh-keygen -l -f my-new-server-key // command. HostKeyFingerprint *string // Specifies information to call a customer-supplied authentication API. This // field is not populated when the IdentityProviderType of a server is // AWS_DIRECTORY_SERVICE or SERVICE_MANAGED . IdentityProviderDetails *IdentityProviderDetails // The mode of authentication for a server. The default value is SERVICE_MANAGED , // which allows you to store and access user credentials within the Transfer Family // service. Use AWS_DIRECTORY_SERVICE to provide access to Active Directory groups // in Directory Service for Microsoft Active Directory or Microsoft Active // Directory in your on-premises environment or in Amazon Web Services using AD // Connector. This option also requires you to provide a Directory ID by using the // IdentityProviderDetails parameter. Use the API_GATEWAY value to integrate with // an identity provider of your choosing. The API_GATEWAY setting requires you to // provide an Amazon API Gateway endpoint URL to call for authentication by using // the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use // an Lambda function as your identity provider. If you choose this value, you must // specify the ARN for the Lambda function in the Function parameter for the // IdentityProviderDetails data type. IdentityProviderType IdentityProviderType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or // Amazon EFSevents. When set, you can view user activity in your CloudWatch logs. LoggingRole *string // Specifies a string to display when users connect to a server. This string is // displayed after the user authenticates. The SFTP protocol does not support // post-authentication display banners. PostAuthenticationLoginBanner *string // Specifies a string to display when users connect to a server. This string is // displayed before the user authenticates. For example, the following banner // displays details about using the system: This system is for the use of // authorized users only. Individuals using this computer system without authority, // or in excess of their authority, are subject to having all of their activities // on this system monitored and recorded by system personnel. PreAuthenticationLoginBanner *string // The protocol settings that are configured for your server. // - To indicate passive mode (for FTP and FTPS protocols), use the PassiveIp // parameter. Enter a single dotted-quad IPv4 address, such as the external IP // address of a firewall, router, or load balancer. // - To ignore the error that is generated when the client attempts to use the // SETSTAT command on a file that you are uploading to an Amazon S3 bucket, use // the SetStatOption parameter. To have the Transfer Family server ignore the // SETSTAT command and upload files without needing to make any changes to your // SFTP client, set the value to ENABLE_NO_OP . If you set the SetStatOption // parameter to ENABLE_NO_OP , Transfer Family generates a log entry to Amazon // CloudWatch Logs, so that you can determine when the client is making a SETSTAT // call. // - To determine whether your Transfer Family server resumes recent, negotiated // sessions through a unique session ID, use the TlsSessionResumptionMode // parameter. // - As2Transports indicates the transport method for the AS2 messages. // Currently, only HTTP is supported. ProtocolDetails *ProtocolDetails // Specifies the file transfer protocol or protocols over which your file transfer // protocol client can connect to your server's endpoint. The available protocols // are: // - SFTP (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH // - FTPS (File Transfer Protocol Secure): File transfer with TLS encryption // - FTP (File Transfer Protocol): Unencrypted file transfer // - AS2 (Applicability Statement 2): used for transporting structured // business-to-business data // // - If you select FTPS , you must choose a certificate stored in Certificate // Manager (ACM) which is used to identify your server when clients connect to it // over FTPS. // - If Protocol includes either FTP or FTPS , then the EndpointType must be VPC // and the IdentityProviderType must be either AWS_DIRECTORY_SERVICE , AWS_LAMBDA // , or API_GATEWAY . // - If Protocol includes FTP , then AddressAllocationIds cannot be associated. // - If Protocol is set only to SFTP , the EndpointType can be set to PUBLIC and // the IdentityProviderType can be set any of the supported identity types: // SERVICE_MANAGED , AWS_DIRECTORY_SERVICE , AWS_LAMBDA , or API_GATEWAY . // - If Protocol includes AS2 , then the EndpointType must be VPC , and domain // must be Amazon S3. Protocols []Protocol // Specifies the name of the security policy that is attached to the server. SecurityPolicyName *string // Specifies the unique system-assigned identifier for a server that you // instantiate. ServerId *string // The condition of the server that was described. A value of ONLINE indicates // that the server can accept jobs and transfer files. A State value of OFFLINE // means that the server cannot perform file transfer operations. The states of // STARTING and STOPPING indicate that the server is in an intermediate state, // either not fully able to respond, or not fully offline. The values of // START_FAILED or STOP_FAILED can indicate an error condition. State State // Specifies the log groups to which your server logs are sent. To specify a log // group, you must provide the ARN for an existing log group. In this case, the // format of the log group is as follows: // arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:* For // example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:* If you // have previously specified a log group for a server, you can clear it, and in // effect turn off structured logging, by providing an empty value for this // parameter in an update-server call. For example: update-server --server-id // s-1234567890abcdef0 --structured-log-destinations StructuredLogDestinations []string // Specifies the key-value pairs that you can use to search for and group servers // that were assigned to the server that was described. Tags []Tag // Specifies the number of users that are assigned to a server you specified with // the ServerId . UserCount *int32 // Specifies the workflow ID for the workflow to assign and the execution role // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when the server session disconnects while the file is still being // uploaded. WorkflowDetails *WorkflowDetails noSmithyDocumentSerde } // Describes the properties of a user that was specified. type DescribedUser struct { // Specifies the unique Amazon Resource Name (ARN) for the user that was requested // to be described. // // This member is required. Arn *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and // keys should be visible to your user and how you want to make them visible. You // must specify the Entry and Target pair, where Entry shows how the path is made // visible and Target is the actual Amazon S3 or Amazon EFS path. If you only // specify a target, it is displayed as is. You also must ensure that your Identity // and Access Management (IAM) role provides access to paths in Target . This value // can be set only when HomeDirectoryType is set to LOGICAL. In most cases, you // can use this value instead of the session policy to lock your user down to the // designated home directory (" chroot "). To do this, you can set Entry to '/' // and set Target to the HomeDirectory parameter value. HomeDirectoryMappings []HomeDirectoryMapEntry // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType HomeDirectoryType // A session policy for your user so that you can use the same Identity and Access // Management (IAM) role across multiple users. This policy scopes down a user's // access to portions of their Amazon S3 bucket. Variables that you can use inside // this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and // ${Transfer:HomeBucket} . Policy *string // Specifies the full POSIX identity, including user ID ( Uid ), group ID ( Gid ), // and any secondary groups IDs ( SecondaryGids ), that controls your users' access // to your Amazon Elastic File System (Amazon EFS) file systems. The POSIX // permissions that are set on files and directories in your file system determine // the level of access your users get when transferring files into and out of your // Amazon EFS file systems. PosixProfile *PosixProfile // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. Role *string // Specifies the public key portion of the Secure Shell (SSH) keys stored for the // described user. SshPublicKeys []SshPublicKey // Specifies the key-value pairs for the user requested. Tag can be used to search // for and group users for a variety of purposes. Tags []Tag // Specifies the name of the user that was requested to be described. User names // are used for authentication purposes. This is the string that will be used by // your user when they log in to your server. UserName *string noSmithyDocumentSerde } // Describes the properties of the specified workflow type DescribedWorkflow struct { // Specifies the unique Amazon Resource Name (ARN) for the workflow. // // This member is required. Arn *string // Specifies the text description for the workflow. Description *string // Specifies the steps (actions) to take if errors are encountered during // execution of the workflow. OnExceptionSteps []WorkflowStep // Specifies the details for the steps that are in the specified workflow. Steps []WorkflowStep // Key-value pairs that can be used to group and search for workflows. Tags are // metadata attached to workflows for any purpose. Tags []Tag // A unique identifier for the workflow. WorkflowId *string noSmithyDocumentSerde } // Specifies the details for the file location for the file that's being used in // the workflow. Only applicable if you are using Amazon Elastic File Systems // (Amazon EFS) for storage. type EfsFileLocation struct { // The identifier of the file system, assigned by Amazon EFS. FileSystemId *string // The pathname for the folder being used by a workflow. Path *string noSmithyDocumentSerde } // The virtual private cloud (VPC) endpoint settings that are configured for your // file transfer protocol-enabled server. With a VPC endpoint, you can restrict // access to your server and resources only within your VPC. To control incoming // internet traffic, invoke the UpdateServer API and attach an Elastic IP address // to your server's endpoint. After May 19, 2021, you won't be able to create a // server using EndpointType=VPC_ENDPOINT in your Amazon Web Servicesaccount if // your account hasn't already done so before May 19, 2021. If you have already // created servers with EndpointType=VPC_ENDPOINT in your Amazon Web // Servicesaccount on or before May 19, 2021, you will not be affected. After this // date, use EndpointType = VPC . For more information, see // https://docs.aws.amazon.com/transfer/latest/userguide/create-server-in-vpc.html#deprecate-vpc-endpoint. type EndpointDetails struct { // A list of address allocation IDs that are required to attach an Elastic IP // address to your server's endpoint. This property can only be set when // EndpointType is set to VPC and it is only valid in the UpdateServer API. AddressAllocationIds []string // A list of security groups IDs that are available to attach to your server's // endpoint. This property can only be set when EndpointType is set to VPC . You // can edit the SecurityGroupIds property in the UpdateServer (https://docs.aws.amazon.com/transfer/latest/userguide/API_UpdateServer.html) // API only if you are changing the EndpointType from PUBLIC or VPC_ENDPOINT to VPC // . To change security groups associated with your server's VPC endpoint after // creation, use the Amazon EC2 ModifyVpcEndpoint (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVpcEndpoint.html) // API. SecurityGroupIds []string // A list of subnet IDs that are required to host your server endpoint in your // VPC. This property can only be set when EndpointType is set to VPC . SubnetIds []string // The identifier of the VPC endpoint. This property can only be set when // EndpointType is set to VPC_ENDPOINT . For more information, see // https://docs.aws.amazon.com/transfer/latest/userguide/create-server-in-vpc.html#deprecate-vpc-endpoint. VpcEndpointId *string // The VPC identifier of the VPC in which a server's endpoint will be hosted. This // property can only be set when EndpointType is set to VPC . VpcId *string noSmithyDocumentSerde } // Specifies the error message and type, for an error that occurs during the // execution of the workflow. type ExecutionError struct { // Specifies the descriptive message that corresponds to the ErrorType . // // This member is required. Message *string // Specifies the error type. // - ALREADY_EXISTS : occurs for a copy step, if the overwrite option is not // selected and a file with the same name already exists in the target location. // - BAD_REQUEST : a general bad request: for example, a step that attempts to // tag an EFS file returns BAD_REQUEST , as only S3 files can be tagged. // - CUSTOM_STEP_FAILED : occurs when the custom step provided a callback that // indicates failure. // - INTERNAL_SERVER_ERROR : a catch-all error that can occur for a variety of // reasons. // - NOT_FOUND : occurs when a requested entity, for example a source file for a // copy step, does not exist. // - PERMISSION_DENIED : occurs if your policy does not contain the correct // permissions to complete one or more of the steps in the workflow. // - TIMEOUT : occurs when the execution times out. You can set the // TimeoutSeconds for a custom step, anywhere from 1 second to 1800 seconds (30 // minutes). // - THROTTLED : occurs if you exceed the new execution refill rate of one // workflow per second. // // This member is required. Type ExecutionErrorType noSmithyDocumentSerde } // Specifies the steps in the workflow, as well as the steps to execute in case of // any errors during workflow execution. type ExecutionResults struct { // Specifies the steps (actions) to take if errors are encountered during // execution of the workflow. OnExceptionSteps []ExecutionStepResult // Specifies the details for the steps that are in the specified workflow. Steps []ExecutionStepResult noSmithyDocumentSerde } // Specifies the following details for the step: error (if any), outputs (if any), // and the step type. type ExecutionStepResult struct { // Specifies the details for an error, if it occurred during execution of the // specified workflow step. Error *ExecutionError // The values for the key/value pair applied as a tag to the file. Only applicable // if the step type is TAG . Outputs *string // One of the available step types. // - COPY - Copy the file to another location. // - CUSTOM - Perform a custom step with an Lambda function target. // - DECRYPT - Decrypt a file that was encrypted before it was uploaded. // - DELETE - Delete the file. // - TAG - Add a tag to the file. StepType WorkflowStepType noSmithyDocumentSerde } // Specifies the Amazon S3 or EFS file details to be used in the step. type FileLocation struct { // Specifies the Amazon EFS identifier and the path for the file being used. EfsFileLocation *EfsFileLocation // Specifies the S3 details for the file being used, such as bucket, ETag, and so // forth. S3FileLocation *S3FileLocation noSmithyDocumentSerde } // Represents an object that contains entries and targets for HomeDirectoryMappings // . The following is an Entry and Target pair example for chroot . [ { "Entry": // "/", "Target": "/bucket_name/home/mydirectory" } ] type HomeDirectoryMapEntry struct { // Represents an entry for HomeDirectoryMappings . // // This member is required. Entry *string // Represents the map target that is used in a HomeDirectorymapEntry . // // This member is required. Target *string noSmithyDocumentSerde } // Returns information related to the type of user authentication that is in use // for a file transfer protocol-enabled server's users. A server can have only one // method of authentication. type IdentityProviderDetails struct { // The identifier of the Directory Service directory that you want to stop sharing. DirectoryId *string // The ARN for a Lambda function to use for the Identity provider. Function *string // This parameter is only applicable if your IdentityProviderType is API_GATEWAY . // Provides the type of InvocationRole used to authenticate the user account. InvocationRole *string // For SFTP-enabled servers, and for custom identity providers only, you can // specify whether to authenticate using a password, SSH key pair, or both. // - PASSWORD - users must provide their password to connect. // - PUBLIC_KEY - users must provide their private key to connect. // - PUBLIC_KEY_OR_PASSWORD - users can authenticate with either their password // or their key. This is the default value. // - PUBLIC_KEY_AND_PASSWORD - users must provide both their private key and // their password to connect. The server checks the key first, and then if the key // is valid, the system prompts for a password. If the private key provided does // not match the public key that is stored, authentication fails. SftpAuthenticationMethods SftpAuthenticationMethods // Provides the location of the service endpoint used to authenticate users. Url *string noSmithyDocumentSerde } // Specifies the location for the file that's being processed. type InputFileLocation struct { // Specifies the details for the Amazon Elastic File System (Amazon EFS) file // that's being decrypted. EfsFileLocation *EfsFileLocation // Specifies the details for the Amazon S3 file that's being copied or decrypted. S3FileLocation *S3InputFileLocation noSmithyDocumentSerde } // Lists the properties for one or more specified associated accesses. type ListedAccess struct { // A unique identifier that is required to identify specific groups within your // directory. The users of the group that you associate have access to your Amazon // S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If // you know the group name, you can view the SID values by running the following // command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like // "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that // command, replace YourGroupName with the name of your Active Directory group. The // regular expression used to validate this parameter is a string of characters // consisting of uppercase and lowercase alphanumeric characters with no spaces. // You can also include underscores or any of the following characters: =,.@:/- ExternalId *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType HomeDirectoryType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. Role *string noSmithyDocumentSerde } // Describes the properties of an agreement. type ListedAgreement struct { // A unique identifier for the agreement. This identifier is returned when you // create an agreement. AgreementId *string // The Amazon Resource Name (ARN) of the specified agreement. Arn *string // The current description for the agreement. You can change it by calling the // UpdateAgreement operation and providing a new description. Description *string // A unique identifier for the AS2 local profile. LocalProfileId *string // A unique identifier for the partner profile. PartnerProfileId *string // The unique identifier for the agreement. ServerId *string // The agreement can be either ACTIVE or INACTIVE . Status AgreementStatusType noSmithyDocumentSerde } // Describes the properties of a certificate. type ListedCertificate struct { // An optional date that specifies when the certificate becomes active. ActiveDate *time.Time // The Amazon Resource Name (ARN) of the specified certificate. Arn *string // An array of identifiers for the imported certificates. You use this identifier // for working with profiles and partner profiles. CertificateId *string // The name or short description that's used to identify the certificate. Description *string // An optional date that specifies when the certificate becomes inactive. InactiveDate *time.Time // The certificate can be either ACTIVE , PENDING_ROTATION , or INACTIVE . // PENDING_ROTATION means that this certificate will replace the current // certificate when it expires. Status CertificateStatusType // The type for the certificate. If a private key has been specified for the // certificate, its type is CERTIFICATE_WITH_PRIVATE_KEY . If there is no private // key, the type is CERTIFICATE . Type CertificateType // Specifies whether this certificate is used for signing or encryption. Usage CertificateUsageType noSmithyDocumentSerde } // Returns details of the connector that is specified. type ListedConnector struct { // The Amazon Resource Name (ARN) of the specified connector. Arn *string // The unique identifier for the connector. ConnectorId *string // The URL of the partner's AS2 endpoint. Url *string noSmithyDocumentSerde } // Returns properties of the execution that is specified. type ListedExecution struct { // A unique identifier for the execution of a workflow. ExecutionId *string // A structure that describes the Amazon S3 or EFS file location. This is the file // location when the execution begins: if the file is being copied, this is the // initial (as opposed to destination) file location. InitialFileLocation *FileLocation // A container object for the session details that are associated with a workflow. ServiceMetadata *ServiceMetadata // The status is one of the execution. Can be in progress, completed, exception // encountered, or handling the exception. Status ExecutionStatus noSmithyDocumentSerde } // Returns properties of the host key that's specified. type ListedHostKey struct { // The unique Amazon Resource Name (ARN) of the host key. // // This member is required. Arn *string // The date on which the host key was added to the server. DateImported *time.Time // The current description for the host key. You can change it by calling the // UpdateHostKey operation and providing a new description. Description *string // The public key fingerprint, which is a short sequence of bytes used to identify // the longer public key. Fingerprint *string // A unique identifier for the host key. HostKeyId *string // The encryption algorithm that is used for the host key. The Type parameter is // specified by using one of the following values: // - ssh-rsa // - ssh-ed25519 // - ecdsa-sha2-nistp256 // - ecdsa-sha2-nistp384 // - ecdsa-sha2-nistp521 Type *string noSmithyDocumentSerde } // Returns the properties of the profile that was specified. type ListedProfile struct { // The Amazon Resource Name (ARN) of the specified profile. Arn *string // The As2Id is the AS2-name, as defined in the RFC 4130 (https://datatracker.ietf.org/doc/html/rfc4130) // . For inbound transfers, this is the AS2-From header for the AS2 messages sent // from the partner. For outbound connectors, this is the AS2-To header for the // AS2 messages sent to the partner using the StartFileTransfer API operation. // This ID cannot include spaces. As2Id *string // A unique identifier for the local or partner AS2 profile. ProfileId *string // Indicates whether to list only LOCAL type profiles or only PARTNER type // profiles. If not supplied in the request, the command lists all types of // profiles. ProfileType ProfileType noSmithyDocumentSerde } // Returns properties of a file transfer protocol-enabled server that was // specified. type ListedServer struct { // Specifies the unique Amazon Resource Name (ARN) for a server to be listed. // // This member is required. Arn *string // Specifies the domain of the storage system that is used for file transfers. Domain Domain // Specifies the type of VPC endpoint that your server is connected to. If your // server is connected to a VPC endpoint, your server isn't accessible over the // public internet. EndpointType EndpointType // The mode of authentication for a server. The default value is SERVICE_MANAGED , // which allows you to store and access user credentials within the Transfer Family // service. Use AWS_DIRECTORY_SERVICE to provide access to Active Directory groups // in Directory Service for Microsoft Active Directory or Microsoft Active // Directory in your on-premises environment or in Amazon Web Services using AD // Connector. This option also requires you to provide a Directory ID by using the // IdentityProviderDetails parameter. Use the API_GATEWAY value to integrate with // an identity provider of your choosing. The API_GATEWAY setting requires you to // provide an Amazon API Gateway endpoint URL to call for authentication by using // the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use // an Lambda function as your identity provider. If you choose this value, you must // specify the ARN for the Lambda function in the Function parameter for the // IdentityProviderDetails data type. IdentityProviderType IdentityProviderType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or // Amazon EFSevents. When set, you can view user activity in your CloudWatch logs. LoggingRole *string // Specifies the unique system assigned identifier for the servers that were // listed. ServerId *string // The condition of the server that was described. A value of ONLINE indicates // that the server can accept jobs and transfer files. A State value of OFFLINE // means that the server cannot perform file transfer operations. The states of // STARTING and STOPPING indicate that the server is in an intermediate state, // either not fully able to respond, or not fully offline. The values of // START_FAILED or STOP_FAILED can indicate an error condition. State State // Specifies the number of users that are assigned to a server you specified with // the ServerId . UserCount *int32 noSmithyDocumentSerde } // Returns properties of the user that you specify. type ListedUser struct { // Provides the unique Amazon Resource Name (ARN) for the user that you want to // learn about. // // This member is required. Arn *string // The landing directory (folder) for a user when they log in to the server using // the client. A HomeDirectory example is /bucket_name/home/mydirectory . HomeDirectory *string // The type of landing directory (folder) that you want your users' home directory // to be when they log in to the server. If you set it to PATH , the user will see // the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol // clients. If you set it LOGICAL , you need to provide mappings in the // HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths // visible to your users. HomeDirectoryType HomeDirectoryType // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that controls your users' access to your Amazon S3 bucket or Amazon EFS file // system. The policies attached to this role determine the level of access that // you want to provide your users when transferring files into and out of your // Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a // trust relationship that allows the server to access your resources when // servicing your users' transfer requests. The IAM role that controls your users' // access to your Amazon S3 bucket for servers with Domain=S3 , or your EFS file // system for servers with Domain=EFS . The policies attached to this role // determine the level of access you want to provide your users when transferring // files into and out of your S3 buckets or EFS file systems. Role *string // Specifies the number of SSH public keys stored for the user you specified. SshPublicKeyCount *int32 // Specifies the name of the user whose ARN was specified. User names are used for // authentication purposes. UserName *string noSmithyDocumentSerde } // Contains the identifier, text description, and Amazon Resource Name (ARN) for // the workflow. type ListedWorkflow struct { // Specifies the unique Amazon Resource Name (ARN) for the workflow. Arn *string // Specifies the text description for the workflow. Description *string // A unique identifier for the workflow. WorkflowId *string noSmithyDocumentSerde } // Consists of the logging role and the log group name. type LoggingConfiguration struct { // The name of the CloudWatch logging group for the Transfer Family server to // which this workflow belongs. LogGroupName *string // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or // Amazon EFSevents. When set, you can view user activity in your CloudWatch logs. LoggingRole *string noSmithyDocumentSerde } // The full POSIX identity, including user ID ( Uid ), group ID ( Gid ), and any // secondary groups IDs ( SecondaryGids ), that controls your users' access to your // Amazon EFS file systems. The POSIX permissions that are set on files and // directories in your file system determine the level of access your users get // when transferring files into and out of your Amazon EFS file systems. type PosixProfile struct { // The POSIX group ID used for all EFS operations by this user. // // This member is required. Gid *int64 // The POSIX user ID used for all EFS operations by this user. // // This member is required. Uid *int64 // The secondary POSIX group IDs used for all EFS operations by this user. SecondaryGids []int64 noSmithyDocumentSerde } // The protocol settings that are configured for your server. type ProtocolDetails struct { // Indicates the transport method for the AS2 messages. Currently, only HTTP is // supported. As2Transports []As2Transport // Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 // address, such as the public IP address of a firewall, router, or load balancer. // For example: aws transfer update-server --protocol-details PassiveIp=0.0.0.0 // Replace 0.0.0.0 in the example above with the actual IP address you want to // use. If you change the PassiveIp value, you must stop and then restart your // Transfer Family server for the change to take effect. For details on using // passive mode (PASV) in a NAT environment, see Configuring your FTPS server // behind a firewall or NAT with Transfer Family (http://aws.amazon.com/blogs/storage/configuring-your-ftps-server-behind-a-firewall-or-nat-with-aws-transfer-family/) // . Special values The AUTO and 0.0.0.0 are special values for the PassiveIp // parameter. The value PassiveIp=AUTO is assigned by default to FTP and FTPS type // servers. In this case, the server automatically responds with one of the // endpoint IPs within the PASV response. PassiveIp=0.0.0.0 has a more unique // application for its usage. For example, if you have a High Availability (HA) // Network Load Balancer (NLB) environment, where you have 3 subnets, you can only // specify a single IP address using the PassiveIp parameter. This reduces the // effectiveness of having High Availability. In this case, you can specify // PassiveIp=0.0.0.0 . This tells the client to use the same IP address as the // Control connection and utilize all AZs for their connections. Note, however, // that not all FTP clients support the PassiveIp=0.0.0.0 response. FileZilla and // WinSCP do support it. If you are using other clients, check to see if your // client supports the PassiveIp=0.0.0.0 response. PassiveIp *string // Use the SetStatOption to ignore the error that is generated when the client // attempts to use SETSTAT on a file you are uploading to an S3 bucket. Some SFTP // file transfer clients can attempt to change the attributes of remote files, // including timestamp and permissions, using commands, such as SETSTAT when // uploading the file. However, these commands are not compatible with object // storage systems, such as Amazon S3. Due to this incompatibility, file uploads // from these clients can result in errors even when the file is otherwise // successfully uploaded. Set the value to ENABLE_NO_OP to have the Transfer // Family server ignore the SETSTAT command, and upload files without needing to // make any changes to your SFTP client. While the SetStatOption ENABLE_NO_OP // setting ignores the error, it does generate a log entry in Amazon CloudWatch // Logs, so you can determine when the client is making a SETSTAT call. If you // want to preserve the original timestamp for your file, and modify other file // attributes using SETSTAT , you can use Amazon EFS as backend storage with // Transfer Family. SetStatOption SetStatOption // A property used with Transfer Family servers that use the FTPS protocol. TLS // Session Resumption provides a mechanism to resume or share a negotiated secret // key between the control and data connection for an FTPS session. // TlsSessionResumptionMode determines whether or not the server resumes recent, // negotiated sessions through a unique session ID. This property is available // during CreateServer and UpdateServer calls. If a TlsSessionResumptionMode value // is not specified during CreateServer , it is set to ENFORCED by default. // - DISABLED : the server does not process TLS session resumption client // requests and creates a new TLS session for each request. // - ENABLED : the server processes and accepts clients that are performing TLS // session resumption. The server doesn't reject client data connections that do // not perform the TLS session resumption client processing. // - ENFORCED : the server processes and accepts clients that are performing TLS // session resumption. The server rejects client data connections that do not // perform the TLS session resumption client processing. Before you set the value // to ENFORCED , test your clients. Not all FTPS clients perform TLS session // resumption. So, if you choose to enforce TLS session resumption, you prevent any // connections from FTPS clients that don't perform the protocol negotiation. To // determine whether or not you can use the ENFORCED value, you need to test your // clients. TlsSessionResumptionMode TlsSessionResumptionMode noSmithyDocumentSerde } // Specifies the details for the file location for the file that's being used in // the workflow. Only applicable if you are using S3 storage. type S3FileLocation struct { // Specifies the S3 bucket that contains the file being used. Bucket *string // The entity tag is a hash of the object. The ETag reflects changes only to the // contents of an object, not its metadata. Etag *string // The name assigned to the file when it was created in Amazon S3. You use the // object key to retrieve the object. Key *string // Specifies the file version. VersionId *string noSmithyDocumentSerde } // Specifies the customer input Amazon S3 file location. If it is used inside // copyStepDetails.DestinationFileLocation , it should be the S3 copy destination. // You need to provide the bucket and key. The key can represent either a path or a // file. This is determined by whether or not you end the key value with the // forward slash (/) character. If the final character is "/", then your file is // copied to the folder, and its name does not change. If, rather, the final // character is alphanumeric, your uploaded file is renamed to the path value. In // this case, if a file with that name already exists, it is overwritten. For // example, if your path is shared-files/bob/ , your uploaded files are copied to // the shared-files/bob/ , folder. If your path is shared-files/today , each // uploaded file is copied to the shared-files folder and named today : each upload // overwrites the previous version of the bob file. type S3InputFileLocation struct { // Specifies the S3 bucket for the customer input file. Bucket *string // The name assigned to the file when it was created in Amazon S3. You use the // object key to retrieve the object. Key *string noSmithyDocumentSerde } // Specifies the key-value pair that are assigned to a file during the execution // of a Tagging step. type S3Tag struct { // The name assigned to the tag that you create. // // This member is required. Key *string // The value that corresponds to the key. // // This member is required. Value *string noSmithyDocumentSerde } // A container object for the session details that are associated with a workflow. type ServiceMetadata struct { // The Server ID ( ServerId ), Session ID ( SessionId ) and user ( UserName ) make // up the UserDetails . // // This member is required. UserDetails *UserDetails noSmithyDocumentSerde } // Provides information about the public Secure Shell (SSH) key that is associated // with a Transfer Family user for the specific file transfer protocol-enabled // server (as identified by ServerId ). The information returned includes the date // the key was imported, the public key contents, and the public key ID. A user can // store more than one SSH public key associated with their user name on a specific // server. type SshPublicKey struct { // Specifies the date that the public key was added to the Transfer Family user. // // This member is required. DateImported *time.Time // Specifies the content of the SSH public key as specified by the PublicKeyId . // Transfer Family accepts RSA, ECDSA, and ED25519 keys. // // This member is required. SshPublicKeyBody *string // Specifies the SshPublicKeyId parameter contains the identifier of the public // key. // // This member is required. SshPublicKeyId *string noSmithyDocumentSerde } // Creates a key-value pair for a specific resource. Tags are metadata that you // can use to search for and group a resource for various purposes. You can apply // tags to servers, users, and roles. A tag key can take more than one value. For // example, to group servers for accounting purposes, you might create a tag called // Group and assign the values Research and Accounting to that group. type Tag struct { // The name assigned to the tag that you create. // // This member is required. Key *string // Contains one or more values that you assigned to the key name you create. // // This member is required. Value *string noSmithyDocumentSerde } // Each step type has its own StepDetails structure. The key/value pairs used to // tag a file during the execution of a workflow step. type TagStepDetails struct { // The name of the step, used as an identifier. Name *string // Specifies which file to use as input to the workflow step: either the output // from the previous step, or the originally uploaded file for the workflow. // - To use the previous file as the input, enter ${previous.file} . In this // case, this workflow step uses the output file from the previous workflow step as // input. This is the default value. // - To use the originally uploaded file location as input for this step, enter // ${original.file} . SourceFileLocation *string // Array that contains from 1 to 10 key/value pairs. Tags []S3Tag noSmithyDocumentSerde } // Specifies the user name, server ID, and session ID for a workflow. type UserDetails struct { // The system-assigned unique identifier for a Transfer server instance. // // This member is required. ServerId *string // A unique string that identifies a Transfer Family user associated with a server. // // This member is required. UserName *string // The system-assigned unique identifier for a session that corresponds to the // workflow. SessionId *string noSmithyDocumentSerde } // Specifies the workflow ID for the workflow to assign and the execution role // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when the server session disconnects while the file is still being // uploaded. type WorkflowDetail struct { // Includes the necessary permissions for S3, EFS, and Lambda operations that // Transfer can assume, so that all workflow steps can operate on the required // resources // // This member is required. ExecutionRole *string // A unique identifier for the workflow. // // This member is required. WorkflowId *string noSmithyDocumentSerde } // Container for the WorkflowDetail data type. It is used by actions that trigger // a workflow to begin execution. type WorkflowDetails struct { // A trigger that starts a workflow if a file is only partially uploaded. You can // attach a workflow to a server that executes whenever there is a partial upload. // A partial upload occurs when a file is open when the session disconnects. OnPartialUpload []WorkflowDetail // A trigger that starts a workflow: the workflow begins to execute after a file // is uploaded. To remove an associated workflow from a server, you can provide an // empty OnUpload object, as in the following example. aws transfer update-server // --server-id s-01234567890abcdef --workflow-details '{"OnUpload":[]}' OnUpload []WorkflowDetail noSmithyDocumentSerde } // The basic building block of a workflow. type WorkflowStep struct { // Details for a step that performs a file copy. Consists of the following values: // - A description // - An Amazon S3 location for the destination of the file copy. // - A flag that indicates whether to overwrite an existing file of the same // name. The default is FALSE . CopyStepDetails *CopyStepDetails // Details for a step that invokes an Lambda function. Consists of the Lambda // function's name, target, and timeout (in seconds). CustomStepDetails *CustomStepDetails // Details for a step that decrypts an encrypted file. Consists of the following // values: // - A descriptive name // - An Amazon S3 or Amazon Elastic File System (Amazon EFS) location for the // source file to decrypt. // - An S3 or Amazon EFS location for the destination of the file decryption. // - A flag that indicates whether to overwrite an existing file of the same // name. The default is FALSE . // - The type of encryption that's used. Currently, only PGP encryption is // supported. DecryptStepDetails *DecryptStepDetails // Details for a step that deletes the file. DeleteStepDetails *DeleteStepDetails // Details for a step that creates one or more tags. You specify one or more tags. // Each tag contains a key-value pair. TagStepDetails *TagStepDetails // Currently, the following step types are supported. // - COPY - Copy the file to another location. // - CUSTOM - Perform a custom step with an Lambda function target. // - DECRYPT - Decrypt a file that was encrypted before it was uploaded. // - DELETE - Delete the file. // - TAG - Add a tag to the file. Type WorkflowStepType noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
1,695
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate import ( "context" cryptorand "crypto/rand" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Translate" const ServiceAPIVersion = "2017-07-01" // Client provides the API client to make operations call for Amazon Translate. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) resolveIdempotencyTokenProvider(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "translate", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
454
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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 translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a parallel data resource in Amazon Translate by importing an input file // from Amazon S3. Parallel data files contain examples that show how you want // segments of text to be translated. By adding parallel data, you can influence // the style, tone, and word choice in your translation output. func (c *Client) CreateParallelData(ctx context.Context, params *CreateParallelDataInput, optFns ...func(*Options)) (*CreateParallelDataOutput, error) { if params == nil { params = &CreateParallelDataInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateParallelData", params, optFns, c.addOperationCreateParallelDataMiddlewares) if err != nil { return nil, err } out := result.(*CreateParallelDataOutput) out.ResultMetadata = metadata return out, nil } type CreateParallelDataInput struct { // A unique identifier for the request. This token is automatically generated when // you use Amazon Translate through an AWS SDK. // // This member is required. ClientToken *string // A custom name for the parallel data resource in Amazon Translate. You must // assign a name that is unique in the account and region. // // This member is required. Name *string // Specifies the format and S3 location of the parallel data input file. // // This member is required. ParallelDataConfig *types.ParallelDataConfig // A custom description for the parallel data resource in Amazon Translate. Description *string // The encryption key used to encrypt this object. EncryptionKey *types.EncryptionKey // Tags to be associated with this resource. A tag is a key-value pair that adds // metadata to a resource. Each tag key for the resource must be unique. For more // information, see Tagging your resources (https://docs.aws.amazon.com/translate/latest/dg/tagging.html) // . Tags []types.Tag noSmithyDocumentSerde } type CreateParallelDataOutput struct { // The custom name that you assigned to the parallel data resource. Name *string // The status of the parallel data resource. When the resource is ready for you to // use, the status is ACTIVE . Status types.ParallelDataStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateParallelDataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateParallelData{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateParallelData{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateParallelDataMiddleware(stack, options); err != nil { return err } if err = addOpCreateParallelDataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateParallelData(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateParallelData struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateParallelData) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateParallelDataInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateParallelDataInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateParallelDataMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateParallelData{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateParallelData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "CreateParallelData", } }
193
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a parallel data resource in Amazon Translate. func (c *Client) DeleteParallelData(ctx context.Context, params *DeleteParallelDataInput, optFns ...func(*Options)) (*DeleteParallelDataOutput, error) { if params == nil { params = &DeleteParallelDataInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteParallelData", params, optFns, c.addOperationDeleteParallelDataMiddlewares) if err != nil { return nil, err } out := result.(*DeleteParallelDataOutput) out.ResultMetadata = metadata return out, nil } type DeleteParallelDataInput struct { // The name of the parallel data resource that is being deleted. // // This member is required. Name *string noSmithyDocumentSerde } type DeleteParallelDataOutput struct { // The name of the parallel data resource that is being deleted. Name *string // The status of the parallel data deletion. Status types.ParallelDataStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteParallelDataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParallelData{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteParallelData{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteParallelDataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParallelData(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteParallelData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "DeleteParallelData", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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" ) // A synchronous action that deletes a custom terminology. func (c *Client) DeleteTerminology(ctx context.Context, params *DeleteTerminologyInput, optFns ...func(*Options)) (*DeleteTerminologyOutput, error) { if params == nil { params = &DeleteTerminologyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteTerminology", params, optFns, c.addOperationDeleteTerminologyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteTerminologyOutput) out.ResultMetadata = metadata return out, nil } type DeleteTerminologyInput struct { // The name of the custom terminology being deleted. // // This member is required. Name *string noSmithyDocumentSerde } type DeleteTerminologyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteTerminologyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTerminology{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTerminology{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteTerminologyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTerminology(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteTerminology(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "DeleteTerminology", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the properties associated with an asynchronous batch translation job // including name, ID, status, source and target languages, input/output S3 // buckets, and so on. func (c *Client) DescribeTextTranslationJob(ctx context.Context, params *DescribeTextTranslationJobInput, optFns ...func(*Options)) (*DescribeTextTranslationJobOutput, error) { if params == nil { params = &DescribeTextTranslationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeTextTranslationJob", params, optFns, c.addOperationDescribeTextTranslationJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeTextTranslationJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeTextTranslationJobInput struct { // The identifier that Amazon Translate generated for the job. The // StartTextTranslationJob operation returns this identifier in its response. // // This member is required. JobId *string noSmithyDocumentSerde } type DescribeTextTranslationJobOutput struct { // An object that contains the properties associated with an asynchronous batch // translation job. TextTranslationJobProperties *types.TextTranslationJobProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeTextTranslationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTextTranslationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTextTranslationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeTextTranslationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTextTranslationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeTextTranslationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "DescribeTextTranslationJob", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides information about a parallel data resource. func (c *Client) GetParallelData(ctx context.Context, params *GetParallelDataInput, optFns ...func(*Options)) (*GetParallelDataOutput, error) { if params == nil { params = &GetParallelDataInput{} } result, metadata, err := c.invokeOperation(ctx, "GetParallelData", params, optFns, c.addOperationGetParallelDataMiddlewares) if err != nil { return nil, err } out := result.(*GetParallelDataOutput) out.ResultMetadata = metadata return out, nil } type GetParallelDataInput struct { // The name of the parallel data resource that is being retrieved. // // This member is required. Name *string noSmithyDocumentSerde } type GetParallelDataOutput struct { // The Amazon S3 location of a file that provides any errors or warnings that were // produced by your input file. This file was created when Amazon Translate // attempted to create a parallel data resource. The location is returned as a // presigned URL to that has a 30-minute expiration. AuxiliaryDataLocation *types.ParallelDataDataLocation // The Amazon S3 location of the most recent parallel data input file that was // successfully imported into Amazon Translate. The location is returned as a // presigned URL that has a 30-minute expiration. Amazon Translate doesn't scan all // input files for the risk of CSV injection attacks. CSV injection occurs when a // .csv or .tsv file is altered so that a record contains malicious code. The // record begins with a special character, such as =, +, -, or @. When the file is // opened in a spreadsheet program, the program might interpret the record as a // formula and run the code within it. Before you download an input file from // Amazon S3, ensure that you recognize the file and trust its creator. DataLocation *types.ParallelDataDataLocation // The Amazon S3 location of a file that provides any errors or warnings that were // produced by your input file. This file was created when Amazon Translate // attempted to update a parallel data resource. The location is returned as a // presigned URL to that has a 30-minute expiration. LatestUpdateAttemptAuxiliaryDataLocation *types.ParallelDataDataLocation // The properties of the parallel data resource that is being retrieved. ParallelDataProperties *types.ParallelDataProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetParallelDataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParallelData{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetParallelData{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetParallelDataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParallelData(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetParallelData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "GetParallelData", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a custom terminology. func (c *Client) GetTerminology(ctx context.Context, params *GetTerminologyInput, optFns ...func(*Options)) (*GetTerminologyOutput, error) { if params == nil { params = &GetTerminologyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetTerminology", params, optFns, c.addOperationGetTerminologyMiddlewares) if err != nil { return nil, err } out := result.(*GetTerminologyOutput) out.ResultMetadata = metadata return out, nil } type GetTerminologyInput struct { // The name of the custom terminology being retrieved. // // This member is required. Name *string // The data format of the custom terminology being retrieved. If you don't specify // this parameter, Amazon Translate returns a file with the same format as the file // that was imported to create the terminology. If you specify this parameter when // you retrieve a multi-directional terminology resource, you must specify the same // format as the input file that was imported to create it. Otherwise, Amazon // Translate throws an error. TerminologyDataFormat types.TerminologyDataFormat noSmithyDocumentSerde } type GetTerminologyOutput struct { // The Amazon S3 location of a file that provides any errors or warnings that were // produced by your input file. This file was created when Amazon Translate // attempted to create a terminology resource. The location is returned as a // presigned URL to that has a 30-minute expiration. AuxiliaryDataLocation *types.TerminologyDataLocation // The Amazon S3 location of the most recent custom terminology input file that // was successfully imported into Amazon Translate. The location is returned as a // presigned URL that has a 30-minute expiration. Amazon Translate doesn't scan all // input files for the risk of CSV injection attacks. CSV injection occurs when a // .csv or .tsv file is altered so that a record contains malicious code. The // record begins with a special character, such as =, +, -, or @. When the file is // opened in a spreadsheet program, the program might interpret the record as a // formula and run the code within it. Before you download an input file from // Amazon S3, ensure that you recognize the file and trust its creator. TerminologyDataLocation *types.TerminologyDataLocation // The properties of the custom terminology being retrieved. TerminologyProperties *types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetTerminologyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTerminology{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTerminology{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetTerminologyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTerminology(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetTerminology(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "GetTerminology", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates a custom terminology, depending on whether one already // exists for the given terminology name. Importing a terminology with the same // name as an existing one will merge the terminologies based on the chosen merge // strategy. The only supported merge strategy is OVERWRITE, where the imported // terminology overwrites the existing terminology of the same name. If you import // a terminology that overwrites an existing one, the new terminology takes up to // 10 minutes to fully propagate. After that, translations have access to the new // terminology. func (c *Client) ImportTerminology(ctx context.Context, params *ImportTerminologyInput, optFns ...func(*Options)) (*ImportTerminologyOutput, error) { if params == nil { params = &ImportTerminologyInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportTerminology", params, optFns, c.addOperationImportTerminologyMiddlewares) if err != nil { return nil, err } out := result.(*ImportTerminologyOutput) out.ResultMetadata = metadata return out, nil } type ImportTerminologyInput struct { // The merge strategy of the custom terminology being imported. Currently, only // the OVERWRITE merge strategy is supported. In this case, the imported // terminology will overwrite an existing terminology of the same name. // // This member is required. MergeStrategy types.MergeStrategy // The name of the custom terminology being imported. // // This member is required. Name *string // The terminology data for the custom terminology being imported. // // This member is required. TerminologyData *types.TerminologyData // The description of the custom terminology being imported. Description *string // The encryption key for the custom terminology being imported. EncryptionKey *types.EncryptionKey // Tags to be associated with this resource. A tag is a key-value pair that adds // metadata to a resource. Each tag key for the resource must be unique. For more // information, see Tagging your resources (https://docs.aws.amazon.com/translate/latest/dg/tagging.html) // . Tags []types.Tag noSmithyDocumentSerde } type ImportTerminologyOutput struct { // The Amazon S3 location of a file that provides any errors or warnings that were // produced by your input file. This file was created when Amazon Translate // attempted to create a terminology resource. The location is returned as a // presigned URL to that has a 30 minute expiration. AuxiliaryDataLocation *types.TerminologyDataLocation // The properties of the custom terminology being imported. TerminologyProperties *types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportTerminologyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportTerminology{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportTerminology{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportTerminologyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportTerminology(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportTerminology(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ImportTerminology", } }
162
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides a list of languages (RFC-5646 codes and names) that Amazon Translate // supports. func (c *Client) ListLanguages(ctx context.Context, params *ListLanguagesInput, optFns ...func(*Options)) (*ListLanguagesOutput, error) { if params == nil { params = &ListLanguagesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListLanguages", params, optFns, c.addOperationListLanguagesMiddlewares) if err != nil { return nil, err } out := result.(*ListLanguagesOutput) out.ResultMetadata = metadata return out, nil } type ListLanguagesInput struct { // The language code for the language to use to display the language names in the // response. The language code is en by default. DisplayLanguageCode types.DisplayLanguageCode // The maximum number of results to return in each response. MaxResults *int32 // Include the NextToken value to fetch the next group of supported languages. NextToken *string noSmithyDocumentSerde } type ListLanguagesOutput struct { // The language code passed in with the request. DisplayLanguageCode types.DisplayLanguageCode // The list of supported languages. Languages []types.Language // If the response does not include all remaining results, use the NextToken in // the next request to fetch the next group of supported languages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListLanguagesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLanguages{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLanguages{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListLanguages(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListLanguagesAPIClient is a client that implements the ListLanguages operation. type ListLanguagesAPIClient interface { ListLanguages(context.Context, *ListLanguagesInput, ...func(*Options)) (*ListLanguagesOutput, error) } var _ ListLanguagesAPIClient = (*Client)(nil) // ListLanguagesPaginatorOptions is the paginator options for ListLanguages type ListLanguagesPaginatorOptions struct { // The maximum number of results to return in each response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListLanguagesPaginator is a paginator for ListLanguages type ListLanguagesPaginator struct { options ListLanguagesPaginatorOptions client ListLanguagesAPIClient params *ListLanguagesInput nextToken *string firstPage bool } // NewListLanguagesPaginator returns a new ListLanguagesPaginator func NewListLanguagesPaginator(client ListLanguagesAPIClient, params *ListLanguagesInput, optFns ...func(*ListLanguagesPaginatorOptions)) *ListLanguagesPaginator { if params == nil { params = &ListLanguagesInput{} } options := ListLanguagesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListLanguagesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListLanguagesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListLanguages page. func (p *ListLanguagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLanguagesOutput, 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.ListLanguages(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_opListLanguages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ListLanguages", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides a list of your parallel data resources in Amazon Translate. func (c *Client) ListParallelData(ctx context.Context, params *ListParallelDataInput, optFns ...func(*Options)) (*ListParallelDataOutput, error) { if params == nil { params = &ListParallelDataInput{} } result, metadata, err := c.invokeOperation(ctx, "ListParallelData", params, optFns, c.addOperationListParallelDataMiddlewares) if err != nil { return nil, err } out := result.(*ListParallelDataOutput) out.ResultMetadata = metadata return out, nil } type ListParallelDataInput struct { // The maximum number of parallel data resources returned for each request. MaxResults *int32 // A string that specifies the next page of results to return in a paginated // response. NextToken *string noSmithyDocumentSerde } type ListParallelDataOutput struct { // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // The properties of the parallel data resources returned by this request. ParallelDataPropertiesList []types.ParallelDataProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListParallelDataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListParallelData{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListParallelData{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListParallelData(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListParallelDataAPIClient is a client that implements the ListParallelData // operation. type ListParallelDataAPIClient interface { ListParallelData(context.Context, *ListParallelDataInput, ...func(*Options)) (*ListParallelDataOutput, error) } var _ ListParallelDataAPIClient = (*Client)(nil) // ListParallelDataPaginatorOptions is the paginator options for ListParallelData type ListParallelDataPaginatorOptions struct { // The maximum number of parallel data resources returned for each request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListParallelDataPaginator is a paginator for ListParallelData type ListParallelDataPaginator struct { options ListParallelDataPaginatorOptions client ListParallelDataAPIClient params *ListParallelDataInput nextToken *string firstPage bool } // NewListParallelDataPaginator returns a new ListParallelDataPaginator func NewListParallelDataPaginator(client ListParallelDataAPIClient, params *ListParallelDataInput, optFns ...func(*ListParallelDataPaginatorOptions)) *ListParallelDataPaginator { if params == nil { params = &ListParallelDataInput{} } options := ListParallelDataPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListParallelDataPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListParallelDataPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListParallelData page. func (p *ListParallelDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListParallelDataOutput, 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.ListParallelData(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_opListParallelData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ListParallelData", } }
219
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all tags associated with a given Amazon Translate resource. For more // information, see Tagging your resources (https://docs.aws.amazon.com/translate/latest/dg/tagging.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 given Amazon Translate resource you are // querying. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // Tags associated with the Amazon Translate resource being queried. A tag is a // key-value pair that adds as a metadata to a resource used by Amazon Translate. // For example, a tag with "Sales" as the key might be added to a resource to // indicate its use by the sales department. 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 } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ListTagsForResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides a list of custom terminologies associated with your account. func (c *Client) ListTerminologies(ctx context.Context, params *ListTerminologiesInput, optFns ...func(*Options)) (*ListTerminologiesOutput, error) { if params == nil { params = &ListTerminologiesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTerminologies", params, optFns, c.addOperationListTerminologiesMiddlewares) if err != nil { return nil, err } out := result.(*ListTerminologiesOutput) out.ResultMetadata = metadata return out, nil } type ListTerminologiesInput struct { // The maximum number of custom terminologies returned per list request. MaxResults *int32 // If the result of the request to ListTerminologies was truncated, include the // NextToken to fetch the next group of custom terminologies. NextToken *string noSmithyDocumentSerde } type ListTerminologiesOutput struct { // If the response to the ListTerminologies was truncated, the NextToken fetches // the next group of custom terminologies. NextToken *string // The properties list of the custom terminologies returned on the list request. TerminologyPropertiesList []types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTerminologiesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTerminologies{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTerminologies{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListTerminologies(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListTerminologiesAPIClient is a client that implements the ListTerminologies // operation. type ListTerminologiesAPIClient interface { ListTerminologies(context.Context, *ListTerminologiesInput, ...func(*Options)) (*ListTerminologiesOutput, error) } var _ ListTerminologiesAPIClient = (*Client)(nil) // ListTerminologiesPaginatorOptions is the paginator options for ListTerminologies type ListTerminologiesPaginatorOptions struct { // The maximum number of custom terminologies returned per list request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListTerminologiesPaginator is a paginator for ListTerminologies type ListTerminologiesPaginator struct { options ListTerminologiesPaginatorOptions client ListTerminologiesAPIClient params *ListTerminologiesInput nextToken *string firstPage bool } // NewListTerminologiesPaginator returns a new ListTerminologiesPaginator func NewListTerminologiesPaginator(client ListTerminologiesAPIClient, params *ListTerminologiesInput, optFns ...func(*ListTerminologiesPaginatorOptions)) *ListTerminologiesPaginator { if params == nil { params = &ListTerminologiesInput{} } options := ListTerminologiesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListTerminologiesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTerminologiesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTerminologies page. func (p *ListTerminologiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTerminologiesOutput, 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.ListTerminologies(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_opListTerminologies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ListTerminologies", } }
219
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a list of the batch translation jobs that you have submitted. func (c *Client) ListTextTranslationJobs(ctx context.Context, params *ListTextTranslationJobsInput, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, error) { if params == nil { params = &ListTextTranslationJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTextTranslationJobs", params, optFns, c.addOperationListTextTranslationJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListTextTranslationJobsOutput) out.ResultMetadata = metadata return out, nil } type ListTextTranslationJobsInput struct { // The parameters that specify which batch translation jobs to retrieve. Filters // include job name, job status, and submission time. You can only set one filter // at a time. Filter *types.TextTranslationJobFilter // The maximum number of results to return in each page. The default value is 100. MaxResults *int32 // The token to request the next page of results. NextToken *string noSmithyDocumentSerde } type ListTextTranslationJobsOutput struct { // The token to use to retrieve the next page of results. This value is null when // there are no more results to return. NextToken *string // A list containing the properties of each job that is returned. TextTranslationJobPropertiesList []types.TextTranslationJobProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTextTranslationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTextTranslationJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTextTranslationJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListTextTranslationJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListTextTranslationJobsAPIClient is a client that implements the // ListTextTranslationJobs operation. type ListTextTranslationJobsAPIClient interface { ListTextTranslationJobs(context.Context, *ListTextTranslationJobsInput, ...func(*Options)) (*ListTextTranslationJobsOutput, error) } var _ ListTextTranslationJobsAPIClient = (*Client)(nil) // ListTextTranslationJobsPaginatorOptions is the paginator options for // ListTextTranslationJobs type ListTextTranslationJobsPaginatorOptions struct { // The maximum number of results to return in each page. The default value is 100. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListTextTranslationJobsPaginator is a paginator for ListTextTranslationJobs type ListTextTranslationJobsPaginator struct { options ListTextTranslationJobsPaginatorOptions client ListTextTranslationJobsAPIClient params *ListTextTranslationJobsInput nextToken *string firstPage bool } // NewListTextTranslationJobsPaginator returns a new // ListTextTranslationJobsPaginator func NewListTextTranslationJobsPaginator(client ListTextTranslationJobsAPIClient, params *ListTextTranslationJobsInput, optFns ...func(*ListTextTranslationJobsPaginatorOptions)) *ListTextTranslationJobsPaginator { if params == nil { params = &ListTextTranslationJobsInput{} } options := ListTextTranslationJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListTextTranslationJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTextTranslationJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTextTranslationJobs page. func (p *ListTextTranslationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, 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.ListTextTranslationJobs(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_opListTextTranslationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "ListTextTranslationJobs", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts an asynchronous batch translation job. Use batch translation jobs to // translate large volumes of text across multiple documents at once. For batch // translation, you can input documents with different source languages (specify // auto as the source language). You can specify one or more target languages. // Batch translation translates each input document into each of the target // languages. For more information, see Asynchronous batch processing (https://docs.aws.amazon.com/translate/latest/dg/async.html) // . Batch translation jobs can be described with the DescribeTextTranslationJob // operation, listed with the ListTextTranslationJobs operation, and stopped with // the StopTextTranslationJob operation. func (c *Client) StartTextTranslationJob(ctx context.Context, params *StartTextTranslationJobInput, optFns ...func(*Options)) (*StartTextTranslationJobOutput, error) { if params == nil { params = &StartTextTranslationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "StartTextTranslationJob", params, optFns, c.addOperationStartTextTranslationJobMiddlewares) if err != nil { return nil, err } out := result.(*StartTextTranslationJobOutput) out.ResultMetadata = metadata return out, nil } type StartTextTranslationJobInput struct { // A unique identifier for the request. This token is generated for you when using // the Amazon Translate SDK. // // This member is required. ClientToken *string // The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) // role that grants Amazon Translate read access to your input data. For more // information, see Identity and access management (https://docs.aws.amazon.com/translate/latest/dg/identity-and-access-management.html) // . // // This member is required. DataAccessRoleArn *string // Specifies the format and location of the input documents for the translation // job. // // This member is required. InputDataConfig *types.InputDataConfig // Specifies the S3 folder to which your job output will be saved. // // This member is required. OutputDataConfig *types.OutputDataConfig // The language code of the input language. Specify the language if all input // documents share the same language. If you don't know the language of the source // files, or your input documents contains different source languages, select auto // . Amazon Translate auto detects the source language for each input document. For // a list of supported language codes, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . // // This member is required. SourceLanguageCode *string // The target languages of the translation job. Enter up to 10 language codes. // Each input file is translated into each target language. Each language code is 2 // or 5 characters long. For a list of language codes, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . // // This member is required. TargetLanguageCodes []string // The name of the batch translation job to be performed. JobName *string // The name of a parallel data resource to add to the translation job. This // resource consists of examples that show how you want segments of text to be // translated. If you specify multiple target languages for the job, the parallel // data file must include translations for all the target languages. When you add // parallel data to a translation job, you create an Active Custom Translation job. // This parameter accepts only one parallel data resource. Active Custom // Translation jobs are priced at a higher rate than other jobs that don't use // parallel data. For more information, see Amazon Translate pricing (http://aws.amazon.com/translate/pricing/) // . For a list of available parallel data resources, use the ListParallelData // operation. For more information, see Customizing your translations with // parallel data (https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-parallel-data.html) // . ParallelDataNames []string // Settings to configure your translation output, including the option to set the // formality level of the output text and the option to mask profane words and // phrases. Settings *types.TranslationSettings // The name of a custom terminology resource to add to the translation job. This // resource lists examples source terms and the desired translation for each term. // This parameter accepts only one custom terminology resource. If you specify // multiple target languages for the job, translate uses the designated terminology // for each requested target language that has an entry for the source term in the // terminology file. For a list of available custom terminology resources, use the // ListTerminologies operation. For more information, see Custom terminology (https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html) // . TerminologyNames []string noSmithyDocumentSerde } type StartTextTranslationJobOutput struct { // The identifier generated for the job. To get the status of a job, use this ID // with the DescribeTextTranslationJob operation. JobId *string // The status of the job. Possible values include: // - SUBMITTED - The job has been received and is queued for processing. // - IN_PROGRESS - Amazon Translate is processing the job. // - COMPLETED - The job was successfully completed and the output is available. // - COMPLETED_WITH_ERROR - The job was completed with errors. The errors can be // analyzed in the job's output. // - FAILED - The job did not complete. To get details, use the // DescribeTextTranslationJob operation. // - STOP_REQUESTED - The user who started the job has requested that it be // stopped. // - STOPPED - The job has been stopped. JobStatus types.JobStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartTextTranslationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartTextTranslationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartTextTranslationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opStartTextTranslationJobMiddleware(stack, options); err != nil { return err } if err = addOpStartTextTranslationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTextTranslationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpStartTextTranslationJob struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartTextTranslationJob) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartTextTranslationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*StartTextTranslationJobInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartTextTranslationJobInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opStartTextTranslationJobMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartTextTranslationJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartTextTranslationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "StartTextTranslationJob", } }
254
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Stops an asynchronous batch translation job that is in progress. If the job's // state is IN_PROGRESS , the job will be marked for termination and put into the // STOP_REQUESTED state. If the job completes before it can be stopped, it is put // into the COMPLETED state. Otherwise, the job is put into the STOPPED state. // Asynchronous batch translation jobs are started with the StartTextTranslationJob // operation. You can use the DescribeTextTranslationJob or ListTextTranslationJobs // operations to get a batch translation job's JobId . func (c *Client) StopTextTranslationJob(ctx context.Context, params *StopTextTranslationJobInput, optFns ...func(*Options)) (*StopTextTranslationJobOutput, error) { if params == nil { params = &StopTextTranslationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "StopTextTranslationJob", params, optFns, c.addOperationStopTextTranslationJobMiddlewares) if err != nil { return nil, err } out := result.(*StopTextTranslationJobOutput) out.ResultMetadata = metadata return out, nil } type StopTextTranslationJobInput struct { // The job ID of the job to be stopped. // // This member is required. JobId *string noSmithyDocumentSerde } type StopTextTranslationJobOutput struct { // The job ID of the stopped batch translation job. JobId *string // The status of the designated job. Upon successful completion, the job's status // will be STOPPED . JobStatus types.JobStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopTextTranslationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopTextTranslationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopTextTranslationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopTextTranslationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopTextTranslationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopTextTranslationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "StopTextTranslationJob", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates a specific tag with a resource. A tag is a key-value pair that adds // as a metadata to a resource. For more information, see Tagging your resources (https://docs.aws.amazon.com/translate/latest/dg/tagging.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 given Amazon Translate resource to which // you want to associate the tags. // // This member is required. ResourceArn *string // Tags being associated with a specific Amazon Translate resource. There can be a // maximum of 50 tags (both existing and pending) associated with a specific // resource. // // 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: "translate", OperationName: "TagResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Translates input text from the source language to the target language. For a // list of available languages and language codes, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . func (c *Client) TranslateText(ctx context.Context, params *TranslateTextInput, optFns ...func(*Options)) (*TranslateTextOutput, error) { if params == nil { params = &TranslateTextInput{} } result, metadata, err := c.invokeOperation(ctx, "TranslateText", params, optFns, c.addOperationTranslateTextMiddlewares) if err != nil { return nil, err } out := result.(*TranslateTextOutput) out.ResultMetadata = metadata return out, nil } type TranslateTextInput struct { // The language code for the language of the source text. For a list of language // codes, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . To have Amazon Translate determine the source language of your text, you can // specify auto in the SourceLanguageCode field. If you specify auto , Amazon // Translate will call Amazon Comprehend (https://docs.aws.amazon.com/comprehend/latest/dg/comprehend-general.html) // to determine the source language. If you specify auto , you must send the // TranslateText request in a region that supports Amazon Comprehend. Otherwise, // the request returns an error indicating that autodetect is not supported. // // This member is required. SourceLanguageCode *string // The language code requested for the language of the target text. For a list of // language codes, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . // // This member is required. TargetLanguageCode *string // The text to translate. The text string can be a maximum of 10,000 bytes long. // Depending on your character set, this may be fewer than 10,000 characters. // // This member is required. Text *string // Settings to configure your translation output, including the option to set the // formality level of the output text and the option to mask profane words and // phrases. Settings *types.TranslationSettings // The name of a terminology list file to add to the translation job. This file // provides source terms and the desired translation for each term. A terminology // list can contain a maximum of 256 terms. You can use one custom terminology // resource in your translation request. Use the ListTerminologies operation to // get the available terminology lists. For more information about custom // terminology lists, see Custom terminology (https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html) // . TerminologyNames []string noSmithyDocumentSerde } type TranslateTextOutput struct { // The language code for the language of the source text. // // This member is required. SourceLanguageCode *string // The language code for the language of the target text. // // This member is required. TargetLanguageCode *string // The translated text. // // This member is required. TranslatedText *string // Optional settings that modify the translation output. AppliedSettings *types.TranslationSettings // The names of the custom terminologies applied to the input text by Amazon // Translate for the translated text response. AppliedTerminologies []types.AppliedTerminology // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTranslateTextMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTranslateText{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTranslateText{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTranslateTextValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTranslateText(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTranslateText(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "TranslateText", } }
180
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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 specific tag associated with an Amazon Translate resource. For more // information, see Tagging your resources (https://docs.aws.amazon.com/translate/latest/dg/tagging.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 given Amazon Translate resource from // which you want to remove the tags. // // This member is required. ResourceArn *string // The initial part of a key-value pair that forms a tag being removed from a // given resource. Keys must be unique and cannot be duplicated for a particular // 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: "translate", OperationName: "UntagResource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates a previously created parallel data resource by importing a new input // file from Amazon S3. func (c *Client) UpdateParallelData(ctx context.Context, params *UpdateParallelDataInput, optFns ...func(*Options)) (*UpdateParallelDataOutput, error) { if params == nil { params = &UpdateParallelDataInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateParallelData", params, optFns, c.addOperationUpdateParallelDataMiddlewares) if err != nil { return nil, err } out := result.(*UpdateParallelDataOutput) out.ResultMetadata = metadata return out, nil } type UpdateParallelDataInput struct { // A unique identifier for the request. This token is automatically generated when // you use Amazon Translate through an AWS SDK. // // This member is required. ClientToken *string // The name of the parallel data resource being updated. // // This member is required. Name *string // Specifies the format and S3 location of the parallel data input file. // // This member is required. ParallelDataConfig *types.ParallelDataConfig // A custom description for the parallel data resource in Amazon Translate. Description *string noSmithyDocumentSerde } type UpdateParallelDataOutput struct { // The time that the most recent update was attempted. LatestUpdateAttemptAt *time.Time // The status of the parallel data update attempt. When the updated parallel data // resource is ready for you to use, the status is ACTIVE . LatestUpdateAttemptStatus types.ParallelDataStatus // The name of the parallel data resource being updated. Name *string // The status of the parallel data resource that you are attempting to update. // Your update request is accepted only if this status is either ACTIVE or FAILED . Status types.ParallelDataStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateParallelDataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateParallelData{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateParallelData{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opUpdateParallelDataMiddleware(stack, options); err != nil { return err } if err = addOpUpdateParallelDataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateParallelData(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpUpdateParallelData struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateParallelData) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*UpdateParallelDataInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateParallelDataInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opUpdateParallelDataMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateParallelData{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateParallelData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "translate", OperationName: "UpdateParallelData", } }
189
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate import ( "bytes" "context" "encoding/base64" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/translate/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_deserializeOpCreateParallelData struct { } func (*awsAwsjson11_deserializeOpCreateParallelData) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateParallelData) 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_deserializeOpErrorCreateParallelData(response, &metadata) } output := &CreateParallelDataOutput{} 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_deserializeOpDocumentCreateParallelDataOutput(&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_deserializeOpErrorCreateParallelData(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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteParallelData struct { } func (*awsAwsjson11_deserializeOpDeleteParallelData) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteParallelData) 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_deserializeOpErrorDeleteParallelData(response, &metadata) } output := &DeleteParallelDataOutput{} 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_deserializeOpDocumentDeleteParallelDataOutput(&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_deserializeOpErrorDeleteParallelData(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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteTerminology struct { } func (*awsAwsjson11_deserializeOpDeleteTerminology) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteTerminology) 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_deserializeOpErrorDeleteTerminology(response, &metadata) } output := &DeleteTerminologyOutput{} 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_deserializeOpErrorDeleteTerminology(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeTextTranslationJob struct { } func (*awsAwsjson11_deserializeOpDescribeTextTranslationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeTextTranslationJob) 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_deserializeOpErrorDescribeTextTranslationJob(response, &metadata) } output := &DescribeTextTranslationJobOutput{} 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_deserializeOpDocumentDescribeTextTranslationJobOutput(&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_deserializeOpErrorDescribeTextTranslationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetParallelData struct { } func (*awsAwsjson11_deserializeOpGetParallelData) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetParallelData) 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_deserializeOpErrorGetParallelData(response, &metadata) } output := &GetParallelDataOutput{} 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_deserializeOpDocumentGetParallelDataOutput(&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_deserializeOpErrorGetParallelData(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetTerminology struct { } func (*awsAwsjson11_deserializeOpGetTerminology) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetTerminology) 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_deserializeOpErrorGetTerminology(response, &metadata) } output := &GetTerminologyOutput{} 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_deserializeOpDocumentGetTerminologyOutput(&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_deserializeOpErrorGetTerminology(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportTerminology struct { } func (*awsAwsjson11_deserializeOpImportTerminology) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportTerminology) 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_deserializeOpErrorImportTerminology(response, &metadata) } output := &ImportTerminologyOutput{} 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_deserializeOpDocumentImportTerminologyOutput(&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_deserializeOpErrorImportTerminology(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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListLanguages struct { } func (*awsAwsjson11_deserializeOpListLanguages) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListLanguages) 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_deserializeOpErrorListLanguages(response, &metadata) } output := &ListLanguagesOutput{} 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_deserializeOpDocumentListLanguagesOutput(&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_deserializeOpErrorListLanguages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedDisplayLanguageCodeException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDisplayLanguageCodeException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListParallelData struct { } func (*awsAwsjson11_deserializeOpListParallelData) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListParallelData) 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_deserializeOpErrorListParallelData(response, &metadata) } output := &ListParallelDataOutput{} 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_deserializeOpDocumentListParallelDataOutput(&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_deserializeOpErrorListParallelData(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(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("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTerminologies struct { } func (*awsAwsjson11_deserializeOpListTerminologies) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListTerminologies) 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_deserializeOpErrorListTerminologies(response, &metadata) } output := &ListTerminologiesOutput{} 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_deserializeOpDocumentListTerminologiesOutput(&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_deserializeOpErrorListTerminologies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTextTranslationJobs struct { } func (*awsAwsjson11_deserializeOpListTextTranslationJobs) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListTextTranslationJobs) 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_deserializeOpErrorListTextTranslationJobs(response, &metadata) } output := &ListTextTranslationJobsOutput{} 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_deserializeOpDocumentListTextTranslationJobsOutput(&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_deserializeOpErrorListTextTranslationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidFilterException", errorCode): return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartTextTranslationJob struct { } func (*awsAwsjson11_deserializeOpStartTextTranslationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartTextTranslationJob) 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_deserializeOpErrorStartTextTranslationJob(response, &metadata) } output := &StartTextTranslationJobOutput{} 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_deserializeOpDocumentStartTextTranslationJobOutput(&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_deserializeOpErrorStartTextTranslationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedLanguagePairException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedLanguagePairException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStopTextTranslationJob struct { } func (*awsAwsjson11_deserializeOpStopTextTranslationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStopTextTranslationJob) 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_deserializeOpErrorStopTextTranslationJob(response, &metadata) } output := &StopTextTranslationJobOutput{} 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_deserializeOpDocumentStopTextTranslationJobOutput(&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_deserializeOpErrorStopTextTranslationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(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 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_deserializeOpDocumentTagResourceOutput(&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_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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTranslateDocument struct { } func (*awsAwsjson11_deserializeOpTranslateDocument) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTranslateDocument) 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_deserializeOpErrorTranslateDocument(response, &metadata) } output := &TranslateDocumentOutput{} 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_deserializeOpDocumentTranslateDocumentOutput(&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_deserializeOpErrorTranslateDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedLanguagePairException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedLanguagePairException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTranslateText struct { } func (*awsAwsjson11_deserializeOpTranslateText) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTranslateText) 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_deserializeOpErrorTranslateText(response, &metadata) } output := &TranslateTextOutput{} 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_deserializeOpDocumentTranslateTextOutput(&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_deserializeOpErrorTranslateText(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("DetectedLanguageLowConfidenceException", errorCode): return awsAwsjson11_deserializeErrorDetectedLanguageLowConfidenceException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TextSizeLimitExceededException", errorCode): return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedLanguagePairException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedLanguagePairException(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 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_deserializeOpDocumentUntagResourceOutput(&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_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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateParallelData struct { } func (*awsAwsjson11_deserializeOpUpdateParallelData) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateParallelData) 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_deserializeOpErrorUpdateParallelData(response, &metadata) } output := &UpdateParallelDataOutput{} 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_deserializeOpDocumentUpdateParallelDataOutput(&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_deserializeOpErrorUpdateParallelData(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("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } 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_deserializeErrorDetectedLanguageLowConfidenceException(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.DetectedLanguageLowConfidenceException{} err := awsAwsjson11_deserializeDocumentDetectedLanguageLowConfidenceException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InternalServerException{} err := awsAwsjson11_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInvalidFilterException(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.InvalidFilterException{} err := awsAwsjson11_deserializeDocumentInvalidFilterException(&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_deserializeErrorInvalidParameterValueException(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.InvalidParameterValueException{} err := awsAwsjson11_deserializeDocumentInvalidParameterValueException(&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_deserializeErrorInvalidRequestException(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.InvalidRequestException{} err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorLimitExceededException(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.LimitExceededException{} err := awsAwsjson11_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 awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceNotFoundException{} err := awsAwsjson11_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 awsAwsjson11_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{} err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorTextSizeLimitExceededException(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.TextSizeLimitExceededException{} err := awsAwsjson11_deserializeDocumentTextSizeLimitExceededException(&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_deserializeErrorTooManyTagsException(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.TooManyTagsException{} err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorUnsupportedDisplayLanguageCodeException(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.UnsupportedDisplayLanguageCodeException{} err := awsAwsjson11_deserializeDocumentUnsupportedDisplayLanguageCodeException(&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_deserializeErrorUnsupportedLanguagePairException(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.UnsupportedLanguagePairException{} err := awsAwsjson11_deserializeDocumentUnsupportedLanguagePairException(&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_deserializeDocumentAppliedTerminology(v **types.AppliedTerminology, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AppliedTerminology if *v == nil { sv = &types.AppliedTerminology{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Terms": if err := awsAwsjson11_deserializeDocumentTermList(&sv.Terms, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAppliedTerminologyList(v *[]types.AppliedTerminology, 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.AppliedTerminology if *v == nil { cv = []types.AppliedTerminology{} } else { cv = *v } for _, value := range shape { var col types.AppliedTerminology destAddr := &col if err := awsAwsjson11_deserializeDocumentAppliedTerminology(&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 String 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDetectedLanguageLowConfidenceException(v **types.DetectedLanguageLowConfidenceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DetectedLanguageLowConfidenceException if *v == nil { sv = &types.DetectedLanguageLowConfidenceException{} } else { sv = *v } for key, value := range shape { switch key { case "DetectedLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.DetectedLanguageCode = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEncryptionKey(v **types.EncryptionKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EncryptionKey if *v == nil { sv = &types.EncryptionKey{} } 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 EncryptionKeyID 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 EncryptionKeyType to be of type string, got %T instead", value) } sv.Type = types.EncryptionKeyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInputDataConfig(v **types.InputDataConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InputDataConfig if *v == nil { sv = &types.InputDataConfig{} } else { sv = *v } for key, value := range shape { switch key { case "ContentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) } sv.ContentType = ptr.String(jtv) } case "S3Uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidFilterException(v **types.InvalidFilterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidFilterException if *v == nil { sv = &types.InvalidFilterException{} } 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 awsAwsjson11_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidParameterValueException if *v == nil { sv = &types.InvalidParameterValueException{} } 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 awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidRequestException if *v == nil { sv = &types.InvalidRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentJobDetails(v **types.JobDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JobDetails if *v == nil { sv = &types.JobDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DocumentsWithErrorsCount": 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.DocumentsWithErrorsCount = ptr.Int32(int32(i64)) } case "InputDocumentsCount": 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.InputDocumentsCount = ptr.Int32(int32(i64)) } case "TranslatedDocumentsCount": 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.TranslatedDocumentsCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLanguage(v **types.Language, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Language if *v == nil { sv = &types.Language{} } else { sv = *v } for key, value := range shape { switch key { case "LanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.LanguageCode = ptr.String(jtv) } case "LanguageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LocalizedNameString to be of type string, got %T instead", value) } sv.LanguageName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLanguageCodeStringList(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 LanguageCodeString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLanguagesList(v *[]types.Language, 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.Language if *v == nil { cv = []types.Language{} } else { cv = *v } for _, value := range shape { var col types.Language destAddr := &col if err := awsAwsjson11_deserializeDocumentLanguage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOutputDataConfig(v **types.OutputDataConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OutputDataConfig if *v == nil { sv = &types.OutputDataConfig{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionKey": if err := awsAwsjson11_deserializeDocumentEncryptionKey(&sv.EncryptionKey, value); err != nil { return err } case "S3Uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParallelDataConfig(v **types.ParallelDataConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParallelDataConfig if *v == nil { sv = &types.ParallelDataConfig{} } else { sv = *v } for key, value := range shape { switch key { case "Format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParallelDataFormat to be of type string, got %T instead", value) } sv.Format = types.ParallelDataFormat(jtv) } case "S3Uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParallelDataDataLocation(v **types.ParallelDataDataLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParallelDataDataLocation if *v == nil { sv = &types.ParallelDataDataLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Location = ptr.String(jtv) } case "RepositoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RepositoryType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParallelDataProperties(v **types.ParallelDataProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParallelDataProperties if *v == nil { sv = &types.ParallelDataProperties{} } 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 ParallelDataArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } 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 "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "EncryptionKey": if err := awsAwsjson11_deserializeDocumentEncryptionKey(&sv.EncryptionKey, value); err != nil { return err } case "FailedRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.FailedRecordCount = ptr.Int64(i64) } case "ImportedDataSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ImportedDataSize = ptr.Int64(i64) } case "ImportedRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ImportedRecordCount = ptr.Int64(i64) } 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 "LatestUpdateAttemptAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestUpdateAttemptAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LatestUpdateAttemptStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParallelDataStatus to be of type string, got %T instead", value) } sv.LatestUpdateAttemptStatus = types.ParallelDataStatus(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnboundedLengthString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParallelDataConfig": if err := awsAwsjson11_deserializeDocumentParallelDataConfig(&sv.ParallelDataConfig, value); err != nil { return err } case "SkippedRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SkippedRecordCount = ptr.Int64(i64) } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParallelDataStatus to be of type string, got %T instead", value) } sv.Status = types.ParallelDataStatus(jtv) } case "TargetLanguageCodes": if err := awsAwsjson11_deserializeDocumentLanguageCodeStringList(&sv.TargetLanguageCodes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParallelDataPropertiesList(v *[]types.ParallelDataProperties, 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.ParallelDataProperties if *v == nil { cv = []types.ParallelDataProperties{} } else { cv = *v } for _, value := range shape { var col types.ParallelDataProperties destAddr := &col if err := awsAwsjson11_deserializeDocumentParallelDataProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentResourceNameList(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 ResourceName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String 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_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTargetLanguageCodeStringList(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 LanguageCodeString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTerm(v **types.Term, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Term if *v == nil { sv = &types.Term{} } else { sv = *v } for key, value := range shape { switch key { case "SourceText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SourceText = ptr.String(jtv) } case "TargetText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TargetText = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTerminologyDataLocation(v **types.TerminologyDataLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TerminologyDataLocation if *v == nil { sv = &types.TerminologyDataLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Location = ptr.String(jtv) } case "RepositoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RepositoryType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTerminologyProperties(v **types.TerminologyProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TerminologyProperties if *v == nil { sv = &types.TerminologyProperties{} } 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 TerminologyArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } 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 "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Directionality": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Directionality to be of type string, got %T instead", value) } sv.Directionality = types.Directionality(jtv) } case "EncryptionKey": if err := awsAwsjson11_deserializeDocumentEncryptionKey(&sv.EncryptionKey, value); err != nil { return err } case "Format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TerminologyDataFormat to be of type string, got %T instead", value) } sv.Format = types.TerminologyDataFormat(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 "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnboundedLengthString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SizeBytes": 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.SizeBytes = ptr.Int32(int32(i64)) } case "SkippedTermCount": 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.SkippedTermCount = ptr.Int32(int32(i64)) } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "TargetLanguageCodes": if err := awsAwsjson11_deserializeDocumentLanguageCodeStringList(&sv.TargetLanguageCodes, value); err != nil { return err } case "TermCount": 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.TermCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTerminologyPropertiesList(v *[]types.TerminologyProperties, 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.TerminologyProperties if *v == nil { cv = []types.TerminologyProperties{} } else { cv = *v } for _, value := range shape { var col types.TerminologyProperties destAddr := &col if err := awsAwsjson11_deserializeDocumentTerminologyProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTermList(v *[]types.Term, 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.Term if *v == nil { cv = []types.Term{} } else { cv = *v } for _, value := range shape { var col types.Term destAddr := &col if err := awsAwsjson11_deserializeDocumentTerm(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTextSizeLimitExceededException(v **types.TextSizeLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextSizeLimitExceededException if *v == nil { sv = &types.TextSizeLimitExceededException{} } 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 awsAwsjson11_deserializeDocumentTextTranslationJobProperties(v **types.TextTranslationJobProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextTranslationJobProperties if *v == nil { sv = &types.TextTranslationJobProperties{} } else { sv = *v } for key, value := range shape { switch key { case "DataAccessRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } sv.DataAccessRoleArn = ptr.String(jtv) } case "EndTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "InputDataConfig": if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { return err } case "JobDetails": if err := awsAwsjson11_deserializeDocumentJobDetails(&sv.JobDetails, value); err != nil { return err } case "JobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobId to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "JobName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobName to be of type string, got %T instead", value) } sv.JobName = ptr.String(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.JobStatus(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnboundedLengthString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "OutputDataConfig": if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { return err } case "ParallelDataNames": if err := awsAwsjson11_deserializeDocumentResourceNameList(&sv.ParallelDataNames, value); err != nil { return err } case "Settings": if err := awsAwsjson11_deserializeDocumentTranslationSettings(&sv.Settings, value); err != nil { return err } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "SubmittedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SubmittedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "TargetLanguageCodes": if err := awsAwsjson11_deserializeDocumentTargetLanguageCodeStringList(&sv.TargetLanguageCodes, value); err != nil { return err } case "TerminologyNames": if err := awsAwsjson11_deserializeDocumentResourceNameList(&sv.TerminologyNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTextTranslationJobPropertiesList(v *[]types.TextTranslationJobProperties, 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.TextTranslationJobProperties if *v == nil { cv = []types.TextTranslationJobProperties{} } else { cv = *v } for _, value := range shape { var col types.TextTranslationJobProperties destAddr := &col if err := awsAwsjson11_deserializeDocumentTextTranslationJobProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyTagsException if *v == nil { sv = &types.TooManyTagsException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "ResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) } sv.ResourceArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTranslatedDocument(v **types.TranslatedDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TranslatedDocument if *v == nil { sv = &types.TranslatedDocument{} } 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 TranslatedDocumentContent to be []byte, got %T instead", value) } dv, err := base64.StdEncoding.DecodeString(jtv) if err != nil { return fmt.Errorf("failed to base64 decode TranslatedDocumentContent, %w", err) } sv.Content = dv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTranslationSettings(v **types.TranslationSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TranslationSettings if *v == nil { sv = &types.TranslationSettings{} } else { sv = *v } for key, value := range shape { switch key { case "Formality": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Formality to be of type string, got %T instead", value) } sv.Formality = types.Formality(jtv) } case "Profanity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Profanity to be of type string, got %T instead", value) } sv.Profanity = types.Profanity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnsupportedDisplayLanguageCodeException(v **types.UnsupportedDisplayLanguageCodeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedDisplayLanguageCodeException if *v == nil { sv = &types.UnsupportedDisplayLanguageCodeException{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.DisplayLanguageCode = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnsupportedLanguagePairException(v **types.UnsupportedLanguagePairException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedLanguagePairException if *v == nil { sv = &types.UnsupportedLanguagePairException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "TargetLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.TargetLanguageCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateParallelDataOutput(v **CreateParallelDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateParallelDataOutput if *v == nil { sv = &CreateParallelDataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName 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 ParallelDataStatus to be of type string, got %T instead", value) } sv.Status = types.ParallelDataStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteParallelDataOutput(v **DeleteParallelDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteParallelDataOutput if *v == nil { sv = &DeleteParallelDataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName 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 ParallelDataStatus to be of type string, got %T instead", value) } sv.Status = types.ParallelDataStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeTextTranslationJobOutput(v **DescribeTextTranslationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTextTranslationJobOutput if *v == nil { sv = &DescribeTextTranslationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "TextTranslationJobProperties": if err := awsAwsjson11_deserializeDocumentTextTranslationJobProperties(&sv.TextTranslationJobProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetParallelDataOutput(v **GetParallelDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetParallelDataOutput if *v == nil { sv = &GetParallelDataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuxiliaryDataLocation": if err := awsAwsjson11_deserializeDocumentParallelDataDataLocation(&sv.AuxiliaryDataLocation, value); err != nil { return err } case "DataLocation": if err := awsAwsjson11_deserializeDocumentParallelDataDataLocation(&sv.DataLocation, value); err != nil { return err } case "LatestUpdateAttemptAuxiliaryDataLocation": if err := awsAwsjson11_deserializeDocumentParallelDataDataLocation(&sv.LatestUpdateAttemptAuxiliaryDataLocation, value); err != nil { return err } case "ParallelDataProperties": if err := awsAwsjson11_deserializeDocumentParallelDataProperties(&sv.ParallelDataProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetTerminologyOutput(v **GetTerminologyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetTerminologyOutput if *v == nil { sv = &GetTerminologyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuxiliaryDataLocation": if err := awsAwsjson11_deserializeDocumentTerminologyDataLocation(&sv.AuxiliaryDataLocation, value); err != nil { return err } case "TerminologyDataLocation": if err := awsAwsjson11_deserializeDocumentTerminologyDataLocation(&sv.TerminologyDataLocation, value); err != nil { return err } case "TerminologyProperties": if err := awsAwsjson11_deserializeDocumentTerminologyProperties(&sv.TerminologyProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportTerminologyOutput(v **ImportTerminologyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportTerminologyOutput if *v == nil { sv = &ImportTerminologyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuxiliaryDataLocation": if err := awsAwsjson11_deserializeDocumentTerminologyDataLocation(&sv.AuxiliaryDataLocation, value); err != nil { return err } case "TerminologyProperties": if err := awsAwsjson11_deserializeDocumentTerminologyProperties(&sv.TerminologyProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListLanguagesOutput(v **ListLanguagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListLanguagesOutput if *v == nil { sv = &ListLanguagesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DisplayLanguageCode to be of type string, got %T instead", value) } sv.DisplayLanguageCode = types.DisplayLanguageCode(jtv) } case "Languages": if err := awsAwsjson11_deserializeDocumentLanguagesList(&sv.Languages, 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_deserializeOpDocumentListParallelDataOutput(v **ListParallelDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListParallelDataOutput if *v == nil { sv = &ListParallelDataOutput{} } 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 "ParallelDataPropertiesList": if err := awsAwsjson11_deserializeDocumentParallelDataPropertiesList(&sv.ParallelDataPropertiesList, 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 "Tags": if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListTerminologiesOutput(v **ListTerminologiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTerminologiesOutput if *v == nil { sv = &ListTerminologiesOutput{} } 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 "TerminologyPropertiesList": if err := awsAwsjson11_deserializeDocumentTerminologyPropertiesList(&sv.TerminologyPropertiesList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListTextTranslationJobsOutput(v **ListTextTranslationJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTextTranslationJobsOutput if *v == nil { sv = &ListTextTranslationJobsOutput{} } 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 "TextTranslationJobPropertiesList": if err := awsAwsjson11_deserializeDocumentTextTranslationJobPropertiesList(&sv.TextTranslationJobPropertiesList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartTextTranslationJobOutput(v **StartTextTranslationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartTextTranslationJobOutput if *v == nil { sv = &StartTextTranslationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "JobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobId to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.JobStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStopTextTranslationJobOutput(v **StopTextTranslationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StopTextTranslationJobOutput if *v == nil { sv = &StopTextTranslationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "JobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobId to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.JobStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TagResourceOutput if *v == nil { sv = &TagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTranslateDocumentOutput(v **TranslateDocumentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TranslateDocumentOutput if *v == nil { sv = &TranslateDocumentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AppliedSettings": if err := awsAwsjson11_deserializeDocumentTranslationSettings(&sv.AppliedSettings, value); err != nil { return err } case "AppliedTerminologies": if err := awsAwsjson11_deserializeDocumentAppliedTerminologyList(&sv.AppliedTerminologies, value); err != nil { return err } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "TargetLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.TargetLanguageCode = ptr.String(jtv) } case "TranslatedDocument": if err := awsAwsjson11_deserializeDocumentTranslatedDocument(&sv.TranslatedDocument, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTranslateTextOutput(v **TranslateTextOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TranslateTextOutput if *v == nil { sv = &TranslateTextOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AppliedSettings": if err := awsAwsjson11_deserializeDocumentTranslationSettings(&sv.AppliedSettings, value); err != nil { return err } case "AppliedTerminologies": if err := awsAwsjson11_deserializeDocumentAppliedTerminologyList(&sv.AppliedTerminologies, value); err != nil { return err } case "SourceLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.SourceLanguageCode = ptr.String(jtv) } case "TargetLanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageCodeString to be of type string, got %T instead", value) } sv.TargetLanguageCode = ptr.String(jtv) } case "TranslatedText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TranslatedTextString to be of type string, got %T instead", value) } sv.TranslatedText = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UntagResourceOutput if *v == nil { sv = &UntagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateParallelDataOutput(v **UpdateParallelDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateParallelDataOutput if *v == nil { sv = &UpdateParallelDataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "LatestUpdateAttemptAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestUpdateAttemptAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LatestUpdateAttemptStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParallelDataStatus to be of type string, got %T instead", value) } sv.LatestUpdateAttemptStatus = types.ParallelDataStatus(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParallelDataStatus to be of type string, got %T instead", value) } sv.Status = types.ParallelDataStatus(jtv) } default: _, _ = key, value } } *v = sv return nil }
5,886
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package translate provides the API client, operations, and parameter types for // Amazon Translate. // // Provides translation of the input content from the source language to the // target language. package translate
9
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate 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/translate/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 = "translate" } 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 translate // goModuleVersion is the tagged release for this module const goModuleVersion = "1.18.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/translate/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpCreateParallelData struct { } func (*awsAwsjson11_serializeOpCreateParallelData) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateParallelData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateParallelDataInput) _ = 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("AWSShineFrontendService_20170701.CreateParallelData") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateParallelDataInput(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_serializeOpDeleteParallelData struct { } func (*awsAwsjson11_serializeOpDeleteParallelData) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteParallelData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteParallelDataInput) _ = 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("AWSShineFrontendService_20170701.DeleteParallelData") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteParallelDataInput(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_serializeOpDeleteTerminology struct { } func (*awsAwsjson11_serializeOpDeleteTerminology) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteTerminology) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteTerminologyInput) _ = 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("AWSShineFrontendService_20170701.DeleteTerminology") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteTerminologyInput(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_serializeOpDescribeTextTranslationJob struct { } func (*awsAwsjson11_serializeOpDescribeTextTranslationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeTextTranslationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeTextTranslationJobInput) _ = 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("AWSShineFrontendService_20170701.DescribeTextTranslationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeTextTranslationJobInput(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_serializeOpGetParallelData struct { } func (*awsAwsjson11_serializeOpGetParallelData) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetParallelData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetParallelDataInput) _ = 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("AWSShineFrontendService_20170701.GetParallelData") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetParallelDataInput(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_serializeOpGetTerminology struct { } func (*awsAwsjson11_serializeOpGetTerminology) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetTerminology) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetTerminologyInput) _ = 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("AWSShineFrontendService_20170701.GetTerminology") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetTerminologyInput(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_serializeOpImportTerminology struct { } func (*awsAwsjson11_serializeOpImportTerminology) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportTerminology) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportTerminologyInput) _ = 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("AWSShineFrontendService_20170701.ImportTerminology") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportTerminologyInput(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_serializeOpListLanguages struct { } func (*awsAwsjson11_serializeOpListLanguages) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListLanguages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListLanguagesInput) _ = 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("AWSShineFrontendService_20170701.ListLanguages") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListLanguagesInput(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_serializeOpListParallelData struct { } func (*awsAwsjson11_serializeOpListParallelData) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListParallelData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListParallelDataInput) _ = 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("AWSShineFrontendService_20170701.ListParallelData") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListParallelDataInput(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("AWSShineFrontendService_20170701.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_serializeOpListTerminologies struct { } func (*awsAwsjson11_serializeOpListTerminologies) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListTerminologies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTerminologiesInput) _ = 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("AWSShineFrontendService_20170701.ListTerminologies") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListTerminologiesInput(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_serializeOpListTextTranslationJobs struct { } func (*awsAwsjson11_serializeOpListTextTranslationJobs) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListTextTranslationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTextTranslationJobsInput) _ = 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("AWSShineFrontendService_20170701.ListTextTranslationJobs") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListTextTranslationJobsInput(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_serializeOpStartTextTranslationJob struct { } func (*awsAwsjson11_serializeOpStartTextTranslationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartTextTranslationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartTextTranslationJobInput) _ = 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("AWSShineFrontendService_20170701.StartTextTranslationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartTextTranslationJobInput(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_serializeOpStopTextTranslationJob struct { } func (*awsAwsjson11_serializeOpStopTextTranslationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStopTextTranslationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopTextTranslationJobInput) _ = 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("AWSShineFrontendService_20170701.StopTextTranslationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStopTextTranslationJobInput(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("AWSShineFrontendService_20170701.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_serializeOpTranslateDocument struct { } func (*awsAwsjson11_serializeOpTranslateDocument) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTranslateDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TranslateDocumentInput) _ = 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("AWSShineFrontendService_20170701.TranslateDocument") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTranslateDocumentInput(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_serializeOpTranslateText struct { } func (*awsAwsjson11_serializeOpTranslateText) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTranslateText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TranslateTextInput) _ = 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("AWSShineFrontendService_20170701.TranslateText") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTranslateTextInput(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("AWSShineFrontendService_20170701.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_serializeOpUpdateParallelData struct { } func (*awsAwsjson11_serializeOpUpdateParallelData) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateParallelData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateParallelDataInput) _ = 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("AWSShineFrontendService_20170701.UpdateParallelData") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateParallelDataInput(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_serializeDocumentDocument(v *types.Document, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Content != nil { ok := object.Key("Content") ok.Base64EncodeBytes(v.Content) } if v.ContentType != nil { ok := object.Key("ContentType") ok.String(*v.ContentType) } return nil } func awsAwsjson11_serializeDocumentEncryptionKey(v *types.EncryptionKey, 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_serializeDocumentInputDataConfig(v *types.InputDataConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ContentType != nil { ok := object.Key("ContentType") ok.String(*v.ContentType) } if v.S3Uri != nil { ok := object.Key("S3Uri") ok.String(*v.S3Uri) } return nil } func awsAwsjson11_serializeDocumentOutputDataConfig(v *types.OutputDataConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EncryptionKey != nil { ok := object.Key("EncryptionKey") if err := awsAwsjson11_serializeDocumentEncryptionKey(v.EncryptionKey, ok); err != nil { return err } } if v.S3Uri != nil { ok := object.Key("S3Uri") ok.String(*v.S3Uri) } return nil } func awsAwsjson11_serializeDocumentParallelDataConfig(v *types.ParallelDataConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Format) > 0 { ok := object.Key("Format") ok.String(string(v.Format)) } if v.S3Uri != nil { ok := object.Key("S3Uri") ok.String(*v.S3Uri) } return nil } func awsAwsjson11_serializeDocumentResourceNameList(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_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentTargetLanguageCodeStringList(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_serializeDocumentTerminologyData(v *types.TerminologyData, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Directionality) > 0 { ok := object.Key("Directionality") ok.String(string(v.Directionality)) } if v.File != nil { ok := object.Key("File") ok.Base64EncodeBytes(v.File) } if len(v.Format) > 0 { ok := object.Key("Format") ok.String(string(v.Format)) } return nil } func awsAwsjson11_serializeDocumentTextTranslationJobFilter(v *types.TextTranslationJobFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobName != nil { ok := object.Key("JobName") ok.String(*v.JobName) } if len(v.JobStatus) > 0 { ok := object.Key("JobStatus") ok.String(string(v.JobStatus)) } if v.SubmittedAfterTime != nil { ok := object.Key("SubmittedAfterTime") ok.Double(smithytime.FormatEpochSeconds(*v.SubmittedAfterTime)) } if v.SubmittedBeforeTime != nil { ok := object.Key("SubmittedBeforeTime") ok.Double(smithytime.FormatEpochSeconds(*v.SubmittedBeforeTime)) } return nil } func awsAwsjson11_serializeDocumentTranslationSettings(v *types.TranslationSettings, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Formality) > 0 { ok := object.Key("Formality") ok.String(string(v.Formality)) } if len(v.Profanity) > 0 { ok := object.Key("Profanity") ok.String(string(v.Profanity)) } return nil } func awsAwsjson11_serializeOpDocumentCreateParallelDataInput(v *CreateParallelDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.EncryptionKey != nil { ok := object.Key("EncryptionKey") if err := awsAwsjson11_serializeDocumentEncryptionKey(v.EncryptionKey, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.ParallelDataConfig != nil { ok := object.Key("ParallelDataConfig") if err := awsAwsjson11_serializeDocumentParallelDataConfig(v.ParallelDataConfig, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDeleteParallelDataInput(v *DeleteParallelDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } return nil } func awsAwsjson11_serializeOpDocumentDeleteTerminologyInput(v *DeleteTerminologyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } return nil } func awsAwsjson11_serializeOpDocumentDescribeTextTranslationJobInput(v *DescribeTextTranslationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } return nil } func awsAwsjson11_serializeOpDocumentGetParallelDataInput(v *GetParallelDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } return nil } func awsAwsjson11_serializeOpDocumentGetTerminologyInput(v *GetTerminologyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if len(v.TerminologyDataFormat) > 0 { ok := object.Key("TerminologyDataFormat") ok.String(string(v.TerminologyDataFormat)) } return nil } func awsAwsjson11_serializeOpDocumentImportTerminologyInput(v *ImportTerminologyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.EncryptionKey != nil { ok := object.Key("EncryptionKey") if err := awsAwsjson11_serializeDocumentEncryptionKey(v.EncryptionKey, ok); err != nil { return err } } if len(v.MergeStrategy) > 0 { ok := object.Key("MergeStrategy") ok.String(string(v.MergeStrategy)) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } if v.TerminologyData != nil { ok := object.Key("TerminologyData") if err := awsAwsjson11_serializeDocumentTerminologyData(v.TerminologyData, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentListLanguagesInput(v *ListLanguagesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DisplayLanguageCode) > 0 { ok := object.Key("DisplayLanguageCode") ok.String(string(v.DisplayLanguageCode)) } 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_serializeOpDocumentListParallelDataInput(v *ListParallelDataInput, 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.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } return nil } func awsAwsjson11_serializeOpDocumentListTerminologiesInput(v *ListTerminologiesInput, 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_serializeOpDocumentListTextTranslationJobsInput(v *ListTextTranslationJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filter != nil { ok := object.Key("Filter") if err := awsAwsjson11_serializeDocumentTextTranslationJobFilter(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_serializeOpDocumentStartTextTranslationJobInput(v *StartTextTranslationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.DataAccessRoleArn != nil { ok := object.Key("DataAccessRoleArn") ok.String(*v.DataAccessRoleArn) } if v.InputDataConfig != nil { ok := object.Key("InputDataConfig") if err := awsAwsjson11_serializeDocumentInputDataConfig(v.InputDataConfig, ok); err != nil { return err } } if v.JobName != nil { ok := object.Key("JobName") ok.String(*v.JobName) } if v.OutputDataConfig != nil { ok := object.Key("OutputDataConfig") if err := awsAwsjson11_serializeDocumentOutputDataConfig(v.OutputDataConfig, ok); err != nil { return err } } if v.ParallelDataNames != nil { ok := object.Key("ParallelDataNames") if err := awsAwsjson11_serializeDocumentResourceNameList(v.ParallelDataNames, ok); err != nil { return err } } if v.Settings != nil { ok := object.Key("Settings") if err := awsAwsjson11_serializeDocumentTranslationSettings(v.Settings, ok); err != nil { return err } } if v.SourceLanguageCode != nil { ok := object.Key("SourceLanguageCode") ok.String(*v.SourceLanguageCode) } if v.TargetLanguageCodes != nil { ok := object.Key("TargetLanguageCodes") if err := awsAwsjson11_serializeDocumentTargetLanguageCodeStringList(v.TargetLanguageCodes, ok); err != nil { return err } } if v.TerminologyNames != nil { ok := object.Key("TerminologyNames") if err := awsAwsjson11_serializeDocumentResourceNameList(v.TerminologyNames, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStopTextTranslationJobInput(v *StopTextTranslationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } return nil } func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentTranslateDocumentInput(v *TranslateDocumentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Document != nil { ok := object.Key("Document") if err := awsAwsjson11_serializeDocumentDocument(v.Document, ok); err != nil { return err } } if v.Settings != nil { ok := object.Key("Settings") if err := awsAwsjson11_serializeDocumentTranslationSettings(v.Settings, ok); err != nil { return err } } if v.SourceLanguageCode != nil { ok := object.Key("SourceLanguageCode") ok.String(*v.SourceLanguageCode) } if v.TargetLanguageCode != nil { ok := object.Key("TargetLanguageCode") ok.String(*v.TargetLanguageCode) } if v.TerminologyNames != nil { ok := object.Key("TerminologyNames") if err := awsAwsjson11_serializeDocumentResourceNameList(v.TerminologyNames, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentTranslateTextInput(v *TranslateTextInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Settings != nil { ok := object.Key("Settings") if err := awsAwsjson11_serializeDocumentTranslationSettings(v.Settings, ok); err != nil { return err } } if v.SourceLanguageCode != nil { ok := object.Key("SourceLanguageCode") ok.String(*v.SourceLanguageCode) } if v.TargetLanguageCode != nil { ok := object.Key("TargetLanguageCode") ok.String(*v.TargetLanguageCode) } if v.TerminologyNames != nil { ok := object.Key("TerminologyNames") if err := awsAwsjson11_serializeDocumentResourceNameList(v.TerminologyNames, ok); err != nil { return err } } if v.Text != nil { ok := object.Key("Text") ok.String(*v.Text) } return nil } func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateParallelDataInput(v *UpdateParallelDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.ParallelDataConfig != nil { ok := object.Key("ParallelDataConfig") if err := awsAwsjson11_serializeDocumentParallelDataConfig(v.ParallelDataConfig, ok); err != nil { return err } } return nil }
1,743
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package translate import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/translate/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateParallelData struct { } func (*validateOpCreateParallelData) ID() string { return "OperationInputValidation" } func (m *validateOpCreateParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateParallelDataInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateParallelDataInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteParallelData struct { } func (*validateOpDeleteParallelData) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteParallelDataInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteParallelDataInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTerminology struct { } func (*validateOpDeleteTerminology) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTerminology) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTerminologyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTerminologyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeTextTranslationJob struct { } func (*validateOpDescribeTextTranslationJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeTextTranslationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeTextTranslationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeTextTranslationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetParallelData struct { } func (*validateOpGetParallelData) ID() string { return "OperationInputValidation" } func (m *validateOpGetParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetParallelDataInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetParallelDataInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetTerminology struct { } func (*validateOpGetTerminology) ID() string { return "OperationInputValidation" } func (m *validateOpGetTerminology) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetTerminologyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetTerminologyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportTerminology struct { } func (*validateOpImportTerminology) ID() string { return "OperationInputValidation" } func (m *validateOpImportTerminology) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportTerminologyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportTerminologyInput(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 validateOpStartTextTranslationJob struct { } func (*validateOpStartTextTranslationJob) ID() string { return "OperationInputValidation" } func (m *validateOpStartTextTranslationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartTextTranslationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartTextTranslationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopTextTranslationJob struct { } func (*validateOpStopTextTranslationJob) ID() string { return "OperationInputValidation" } func (m *validateOpStopTextTranslationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopTextTranslationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopTextTranslationJobInput(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 validateOpTranslateDocument struct { } func (*validateOpTranslateDocument) ID() string { return "OperationInputValidation" } func (m *validateOpTranslateDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TranslateDocumentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTranslateDocumentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTranslateText struct { } func (*validateOpTranslateText) ID() string { return "OperationInputValidation" } func (m *validateOpTranslateText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TranslateTextInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTranslateTextInput(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 validateOpUpdateParallelData struct { } func (*validateOpUpdateParallelData) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateParallelData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateParallelDataInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateParallelDataInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateParallelDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateParallelData{}, middleware.After) } func addOpDeleteParallelDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteParallelData{}, middleware.After) } func addOpDeleteTerminologyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTerminology{}, middleware.After) } func addOpDescribeTextTranslationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeTextTranslationJob{}, middleware.After) } func addOpGetParallelDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetParallelData{}, middleware.After) } func addOpGetTerminologyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTerminology{}, middleware.After) } func addOpImportTerminologyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportTerminology{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartTextTranslationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartTextTranslationJob{}, middleware.After) } func addOpStopTextTranslationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopTextTranslationJob{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpTranslateDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTranslateDocument{}, middleware.After) } func addOpTranslateTextValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTranslateText{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateParallelDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateParallelData{}, middleware.After) } func validateDocument(v *types.Document) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Document"} if v.Content == nil { invalidParams.Add(smithy.NewErrParamRequired("Content")) } if v.ContentType == nil { invalidParams.Add(smithy.NewErrParamRequired("ContentType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEncryptionKey(v *types.EncryptionKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EncryptionKey"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateInputDataConfig(v *types.InputDataConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "InputDataConfig"} if v.S3Uri == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Uri")) } if v.ContentType == nil { invalidParams.Add(smithy.NewErrParamRequired("ContentType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOutputDataConfig(v *types.OutputDataConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OutputDataConfig"} if v.S3Uri == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Uri")) } if v.EncryptionKey != nil { if err := validateEncryptionKey(v.EncryptionKey); err != nil { invalidParams.AddNested("EncryptionKey", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateParallelDataConfig(v *types.ParallelDataConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ParallelDataConfig"} if v.S3Uri == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Uri")) } if len(v.Format) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Format")) } 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 validateTerminologyData(v *types.TerminologyData) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TerminologyData"} if v.File == nil { invalidParams.Add(smithy.NewErrParamRequired("File")) } if len(v.Format) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Format")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateParallelDataInput(v *CreateParallelDataInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateParallelDataInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.ParallelDataConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("ParallelDataConfig")) } else if v.ParallelDataConfig != nil { if err := validateParallelDataConfig(v.ParallelDataConfig); err != nil { invalidParams.AddNested("ParallelDataConfig", err.(smithy.InvalidParamsError)) } } if v.EncryptionKey != nil { if err := validateEncryptionKey(v.EncryptionKey); err != nil { invalidParams.AddNested("EncryptionKey", err.(smithy.InvalidParamsError)) } } if v.ClientToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) } 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 validateOpDeleteParallelDataInput(v *DeleteParallelDataInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteParallelDataInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTerminologyInput(v *DeleteTerminologyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTerminologyInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeTextTranslationJobInput(v *DescribeTextTranslationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeTextTranslationJobInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetParallelDataInput(v *GetParallelDataInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetParallelDataInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetTerminologyInput(v *GetTerminologyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetTerminologyInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpImportTerminologyInput(v *ImportTerminologyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportTerminologyInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.MergeStrategy) == 0 { invalidParams.Add(smithy.NewErrParamRequired("MergeStrategy")) } if v.TerminologyData == nil { invalidParams.Add(smithy.NewErrParamRequired("TerminologyData")) } else if v.TerminologyData != nil { if err := validateTerminologyData(v.TerminologyData); err != nil { invalidParams.AddNested("TerminologyData", err.(smithy.InvalidParamsError)) } } if v.EncryptionKey != nil { if err := validateEncryptionKey(v.EncryptionKey); err != nil { invalidParams.AddNested("EncryptionKey", 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 validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartTextTranslationJobInput(v *StartTextTranslationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartTextTranslationJobInput"} if v.InputDataConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("InputDataConfig")) } else if v.InputDataConfig != nil { if err := validateInputDataConfig(v.InputDataConfig); err != nil { invalidParams.AddNested("InputDataConfig", err.(smithy.InvalidParamsError)) } } if v.OutputDataConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("OutputDataConfig")) } else if v.OutputDataConfig != nil { if err := validateOutputDataConfig(v.OutputDataConfig); err != nil { invalidParams.AddNested("OutputDataConfig", err.(smithy.InvalidParamsError)) } } if v.DataAccessRoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("DataAccessRoleArn")) } if v.SourceLanguageCode == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceLanguageCode")) } if v.TargetLanguageCodes == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetLanguageCodes")) } if v.ClientToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopTextTranslationJobInput(v *StopTextTranslationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopTextTranslationJobInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTranslateDocumentInput(v *TranslateDocumentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TranslateDocumentInput"} if v.Document == nil { invalidParams.Add(smithy.NewErrParamRequired("Document")) } else if v.Document != nil { if err := validateDocument(v.Document); err != nil { invalidParams.AddNested("Document", err.(smithy.InvalidParamsError)) } } if v.SourceLanguageCode == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceLanguageCode")) } if v.TargetLanguageCode == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetLanguageCode")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTranslateTextInput(v *TranslateTextInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TranslateTextInput"} if v.Text == nil { invalidParams.Add(smithy.NewErrParamRequired("Text")) } if v.SourceLanguageCode == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceLanguageCode")) } if v.TargetLanguageCode == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetLanguageCode")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateParallelDataInput(v *UpdateParallelDataInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateParallelDataInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.ParallelDataConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("ParallelDataConfig")) } else if v.ParallelDataConfig != nil { if err := validateParallelDataConfig(v.ParallelDataConfig); err != nil { invalidParams.AddNested("ParallelDataConfig", err.(smithy.InvalidParamsError)) } } if v.ClientToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
841
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 Translate 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: "translate.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "translate-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-1-fips", }: endpoints.Endpoint{ Hostname: "translate-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2-fips", }: endpoints.Endpoint{ Hostname: "translate-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.us-west-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2-fips", }: endpoints.Endpoint{ Hostname: "translate-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "translate.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "translate-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{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: "translate-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{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: "translate-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{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: "translate-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{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: "translate.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "translate-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "translate.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "translate-fips.us-gov-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1-fips", }: endpoints.Endpoint{ Hostname: "translate-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, }, }, }
417
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 Directionality string // Enum values for Directionality const ( DirectionalityUni Directionality = "UNI" DirectionalityMulti Directionality = "MULTI" ) // Values returns all known values for Directionality. 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 (Directionality) Values() []Directionality { return []Directionality{ "UNI", "MULTI", } } type DisplayLanguageCode string // Enum values for DisplayLanguageCode const ( DisplayLanguageCodeDe DisplayLanguageCode = "de" DisplayLanguageCodeEn DisplayLanguageCode = "en" DisplayLanguageCodeEs DisplayLanguageCode = "es" DisplayLanguageCodeFr DisplayLanguageCode = "fr" DisplayLanguageCodeIt DisplayLanguageCode = "it" DisplayLanguageCodeJa DisplayLanguageCode = "ja" DisplayLanguageCodeKo DisplayLanguageCode = "ko" DisplayLanguageCodePt DisplayLanguageCode = "pt" DisplayLanguageCodeZh DisplayLanguageCode = "zh" DisplayLanguageCodeZhTw DisplayLanguageCode = "zh-TW" ) // Values returns all known values for DisplayLanguageCode. 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 (DisplayLanguageCode) Values() []DisplayLanguageCode { return []DisplayLanguageCode{ "de", "en", "es", "fr", "it", "ja", "ko", "pt", "zh", "zh-TW", } } type EncryptionKeyType string // Enum values for EncryptionKeyType const ( EncryptionKeyTypeKms EncryptionKeyType = "KMS" ) // Values returns all known values for EncryptionKeyType. 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 (EncryptionKeyType) Values() []EncryptionKeyType { return []EncryptionKeyType{ "KMS", } } type Formality string // Enum values for Formality const ( FormalityFormal Formality = "FORMAL" FormalityInformal Formality = "INFORMAL" ) // Values returns all known values for Formality. 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 (Formality) Values() []Formality { return []Formality{ "FORMAL", "INFORMAL", } } type JobStatus string // Enum values for JobStatus const ( JobStatusSubmitted JobStatus = "SUBMITTED" JobStatusInProgress JobStatus = "IN_PROGRESS" JobStatusCompleted JobStatus = "COMPLETED" JobStatusCompletedWithError JobStatus = "COMPLETED_WITH_ERROR" JobStatusFailed JobStatus = "FAILED" JobStatusStopRequested JobStatus = "STOP_REQUESTED" JobStatusStopped JobStatus = "STOPPED" ) // Values returns all known values for JobStatus. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. func (JobStatus) Values() []JobStatus { return []JobStatus{ "SUBMITTED", "IN_PROGRESS", "COMPLETED", "COMPLETED_WITH_ERROR", "FAILED", "STOP_REQUESTED", "STOPPED", } } type MergeStrategy string // Enum values for MergeStrategy const ( MergeStrategyOverwrite MergeStrategy = "OVERWRITE" ) // Values returns all known values for MergeStrategy. 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 (MergeStrategy) Values() []MergeStrategy { return []MergeStrategy{ "OVERWRITE", } } type ParallelDataFormat string // Enum values for ParallelDataFormat const ( ParallelDataFormatTsv ParallelDataFormat = "TSV" ParallelDataFormatCsv ParallelDataFormat = "CSV" ParallelDataFormatTmx ParallelDataFormat = "TMX" ) // Values returns all known values for ParallelDataFormat. 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 (ParallelDataFormat) Values() []ParallelDataFormat { return []ParallelDataFormat{ "TSV", "CSV", "TMX", } } type ParallelDataStatus string // Enum values for ParallelDataStatus const ( ParallelDataStatusCreating ParallelDataStatus = "CREATING" ParallelDataStatusUpdating ParallelDataStatus = "UPDATING" ParallelDataStatusActive ParallelDataStatus = "ACTIVE" ParallelDataStatusDeleting ParallelDataStatus = "DELETING" ParallelDataStatusFailed ParallelDataStatus = "FAILED" ) // Values returns all known values for ParallelDataStatus. 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 (ParallelDataStatus) Values() []ParallelDataStatus { return []ParallelDataStatus{ "CREATING", "UPDATING", "ACTIVE", "DELETING", "FAILED", } } type Profanity string // Enum values for Profanity const ( ProfanityMask Profanity = "MASK" ) // Values returns all known values for Profanity. 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 (Profanity) Values() []Profanity { return []Profanity{ "MASK", } } type TerminologyDataFormat string // Enum values for TerminologyDataFormat const ( TerminologyDataFormatCsv TerminologyDataFormat = "CSV" TerminologyDataFormatTmx TerminologyDataFormat = "TMX" TerminologyDataFormatTsv TerminologyDataFormat = "TSV" ) // Values returns all known values for TerminologyDataFormat. 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 (TerminologyDataFormat) Values() []TerminologyDataFormat { return []TerminologyDataFormat{ "CSV", "TMX", "TSV", } }
214
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" ) // Another modification is being made. That modification must complete before you // can make your change. 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 } // There was a conflict processing the request. Try your request again. 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 confidence that Amazon Comprehend accurately detected the source language // is low. If a low confidence level is acceptable for your application, you can // use the language in the exception to call Amazon Translate again. For more // information, see the DetectDominantLanguage (https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectDominantLanguage.html) // operation in the Amazon Comprehend Developer Guide. type DetectedLanguageLowConfidenceException struct { Message *string ErrorCodeOverride *string DetectedLanguageCode *string noSmithyDocumentSerde } func (e *DetectedLanguageLowConfidenceException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DetectedLanguageLowConfidenceException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DetectedLanguageLowConfidenceException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DetectedLanguageLowConfidenceException" } return *e.ErrorCodeOverride } func (e *DetectedLanguageLowConfidenceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An internal server error occurred. Retry your request. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The filter specified for the operation is not valid. Specify a different filter. type InvalidFilterException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidFilterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidFilterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidFilterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidFilterException" } return *e.ErrorCodeOverride } func (e *InvalidFilterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The value of the parameter is not valid. Review the value of the parameter you // are using to correct it, and then retry your operation. type InvalidParameterValueException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidParameterValueException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterValueException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterValueException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidParameterValueException" } return *e.ErrorCodeOverride } func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request that you made is not valid. Check your request to determine why // it's not valid and then retry the request. type InvalidRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidRequestException" } return *e.ErrorCodeOverride } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified limit has been exceeded. Review your request and retry it with a // quantity below the stated limit. 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 } // The resource you are looking for has not been found. Review the resource you're // looking for and see if a different resource will accomplish your needs before // retrying the revised request. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The Amazon Translate service is temporarily unavailable. Wait a bit and then // retry your request. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The size of the text you submitted exceeds the size limit. Reduce the size of // the text or use a smaller document and then retry your request. type TextSizeLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TextSizeLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TextSizeLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TextSizeLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TextSizeLimitExceededException" } return *e.ErrorCodeOverride } func (e *TextSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have made too many requests within a short period of time. Wait for a short // time and then try your request again. type TooManyRequestsException struct { Message *string ErrorCodeOverride *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 } // You have added too many tags to this resource. The maximum is 50 tags. type TooManyTagsException struct { Message *string ErrorCodeOverride *string ResourceArn *string noSmithyDocumentSerde } func (e *TooManyTagsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyTagsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyTagsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyTagsException" } return *e.ErrorCodeOverride } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Requested display language code is not supported. type UnsupportedDisplayLanguageCodeException struct { Message *string ErrorCodeOverride *string DisplayLanguageCode *string noSmithyDocumentSerde } func (e *UnsupportedDisplayLanguageCodeException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedDisplayLanguageCodeException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedDisplayLanguageCodeException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnsupportedDisplayLanguageCodeException" } return *e.ErrorCodeOverride } func (e *UnsupportedDisplayLanguageCodeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Translate does not support translation from the language of the source // text into the requested target language. For more information, see Supported // languages (https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html) // . type UnsupportedLanguagePairException struct { Message *string ErrorCodeOverride *string SourceLanguageCode *string TargetLanguageCode *string noSmithyDocumentSerde } func (e *UnsupportedLanguagePairException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedLanguagePairException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedLanguagePairException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnsupportedLanguagePairException" } return *e.ErrorCodeOverride } func (e *UnsupportedLanguagePairException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
428
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // The custom terminology applied to the input text by Amazon Translate for the // translated text response. This is optional in the response and will only be // present if you specified terminology input in the request. Currently, only one // terminology can be applied per TranslateText request. type AppliedTerminology struct { // The name of the custom terminology applied to the input text by Amazon // Translate for the translated text response. Name *string // The specific terms of the custom terminology applied to the input text by // Amazon Translate for the translated text response. A maximum of 250 terms will // be returned, and the specific terms applied will be the first 250 terms in the // source text. Terms []Term noSmithyDocumentSerde } // The content and content type of a document. type Document struct { // The Content field type is Binary large object (blob). This object contains the // document content converted into base64-encoded binary data. If you use one of // the AWS SDKs, the SDK performs the Base64-encoding on this field before sending // the request. // // This member is required. Content []byte // Describes the format of the document. You can specify one of the following: // - text/html - The input data consists of HTML content. Amazon Translate // translates only the text in the HTML element. // - text/plain - The input data consists of unformatted text. Amazon Translate // translates every character in the content. // // This member is required. ContentType *string noSmithyDocumentSerde } // The encryption key used to encrypt this object. type EncryptionKey struct { // The Amazon Resource Name (ARN) of the encryption key being used to encrypt this // object. // // This member is required. Id *string // The type of encryption key used by Amazon Translate to encrypt this object. // // This member is required. Type EncryptionKeyType noSmithyDocumentSerde } // The input configuration properties for requesting a batch translation job. type InputDataConfig struct { // Describes the format of the data that you submit to Amazon Translate as input. // You can specify one of the following multipurpose internet mail extension (MIME) // types: // - text/html : The input data consists of one or more HTML files. Amazon // Translate translates only the text that resides in the html element in each // file. // - text/plain : The input data consists of one or more unformatted text files. // Amazon Translate translates every character in this type of input. // - application/vnd.openxmlformats-officedocument.wordprocessingml.document : // The input data consists of one or more Word documents (.docx). // - application/vnd.openxmlformats-officedocument.presentationml.presentation : // The input data consists of one or more PowerPoint Presentation files (.pptx). // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet : The // input data consists of one or more Excel Workbook files (.xlsx). // - application/x-xliff+xml : The input data consists of one or more XML // Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate // supports only XLIFF version 1.2. // If you structure your input data as HTML, ensure that you set this parameter to // text/html . By doing so, you cut costs by limiting the translation to the // contents of the html element in each file. Otherwise, if you set this parameter // to text/plain , your costs will cover the translation of every character. // // This member is required. ContentType *string // The URI of the AWS S3 folder that contains the input files. Amazon Translate // translates all the files in the folder and all its sub-folders. The folder must // be in the same Region as the API endpoint you are calling. // // This member is required. S3Uri *string noSmithyDocumentSerde } // The number of documents successfully and unsuccessfully processed during a // translation job. type JobDetails struct { // The number of documents that could not be processed during a translation job. DocumentsWithErrorsCount *int32 // The number of documents used as input in a translation job. InputDocumentsCount *int32 // The number of documents successfully processed during a translation job. TranslatedDocumentsCount *int32 noSmithyDocumentSerde } // A supported language. type Language struct { // Language code for the supported language. // // This member is required. LanguageCode *string // Language name of the supported language. // // This member is required. LanguageName *string noSmithyDocumentSerde } // The output configuration properties for a batch translation job. type OutputDataConfig struct { // The URI of the S3 folder that contains a translation job's output file. The // folder must be in the same Region as the API endpoint that you are calling. // // This member is required. S3Uri *string // The encryption key used to encrypt this object. EncryptionKey *EncryptionKey noSmithyDocumentSerde } // Specifies the format and S3 location of the parallel data input file. type ParallelDataConfig struct { // The format of the parallel data input file. // // This member is required. Format ParallelDataFormat // The URI of the Amazon S3 folder that contains the parallel data input file. The // folder must be in the same Region as the API endpoint you are calling. // // This member is required. S3Uri *string noSmithyDocumentSerde } // The location of the most recent parallel data input file that was successfully // imported into Amazon Translate. type ParallelDataDataLocation struct { // The Amazon S3 location of the parallel data input file. The location is // returned as a presigned URL to that has a 30-minute expiration. Amazon Translate // doesn't scan all input files for the risk of CSV injection attacks. CSV // injection occurs when a .csv or .tsv file is altered so that a record contains // malicious code. The record begins with a special character, such as =, +, -, or // @. When the file is opened in a spreadsheet program, the program might interpret // the record as a formula and run the code within it. Before you download an input // file from Amazon S3, ensure that you recognize the file and trust its creator. // // This member is required. Location *string // Describes the repository that contains the parallel data input file. // // This member is required. RepositoryType *string noSmithyDocumentSerde } // The properties of a parallel data resource. type ParallelDataProperties struct { // The Amazon Resource Name (ARN) of the parallel data resource. Arn *string // The time at which the parallel data resource was created. CreatedAt *time.Time // The description assigned to the parallel data resource. Description *string // The encryption key used to encrypt this object. EncryptionKey *EncryptionKey // The number of records unsuccessfully imported from the parallel data input file. FailedRecordCount *int64 // The number of UTF-8 characters that Amazon Translate imported from the parallel // data input file. This number includes only the characters in your translation // examples. It does not include characters that are used to format your file. For // example, if you provided a Translation Memory Exchange (.tmx) file, this number // does not include the tags. ImportedDataSize *int64 // The number of records successfully imported from the parallel data input file. ImportedRecordCount *int64 // The time at which the parallel data resource was last updated. LastUpdatedAt *time.Time // The time that the most recent update was attempted. LatestUpdateAttemptAt *time.Time // The status of the most recent update attempt for the parallel data resource. LatestUpdateAttemptStatus ParallelDataStatus // Additional information from Amazon Translate about the parallel data resource. Message *string // The custom name assigned to the parallel data resource. Name *string // Specifies the format and S3 location of the parallel data input file. ParallelDataConfig *ParallelDataConfig // The number of items in the input file that Amazon Translate skipped when you // created or updated the parallel data resource. For example, Amazon Translate // skips empty records, empty target texts, and empty lines. SkippedRecordCount *int64 // The source language of the translations in the parallel data file. SourceLanguageCode *string // The status of the parallel data resource. When the parallel data is ready for // you to use, the status is ACTIVE . Status ParallelDataStatus // The language codes for the target languages available in the parallel data // file. All possible target languages are returned as an array. TargetLanguageCodes []string noSmithyDocumentSerde } // A key-value pair that adds as a metadata to a resource used by Amazon Translate. type Tag struct { // The initial part of a key-value pair that forms a tag associated with a given // resource. // // This member is required. Key *string // The second part of a key-value pair that forms a tag associated with a given // resource. // // This member is required. Value *string noSmithyDocumentSerde } // The term being translated by the custom terminology. type Term struct { // The source text of the term being translated by the custom terminology. SourceText *string // The target text of the term being translated by the custom terminology. TargetText *string noSmithyDocumentSerde } // The data associated with the custom terminology. For information about the // custom terminology file, see Creating a Custom Terminology (https://docs.aws.amazon.com/translate/latest/dg/creating-custom-terminology.html) // . type TerminologyData struct { // The file containing the custom terminology data. Your version of the AWS SDK // performs a Base64-encoding on this field before sending a request to the AWS // service. Users of the SDK should not perform Base64-encoding themselves. // // This member is required. File []byte // The data format of the custom terminology. // // This member is required. Format TerminologyDataFormat // The directionality of your terminology resource indicates whether it has one // source language (uni-directional) or multiple (multi-directional). UNI The // terminology resource has one source language (for example, the first column in a // CSV file), and all of its other languages are target languages. MULTI Any // language in the terminology resource can be the source language or a target // language. A single multi-directional terminology resource can be used for jobs // that translate different language pairs. For example, if the terminology // contains English and Spanish terms, it can be used for jobs that translate // English to Spanish and Spanish to English. When you create a custom terminology // resource without specifying the directionality, it behaves as uni-directional // terminology, although this parameter will have a null value. Directionality Directionality noSmithyDocumentSerde } // The location of the custom terminology data. type TerminologyDataLocation struct { // The Amazon S3 location of the most recent custom terminology input file that // was successfully imported into Amazon Translate. The location is returned as a // presigned URL that has a 30-minute expiration . Amazon Translate doesn't scan // all input files for the risk of CSV injection attacks. CSV injection occurs when // a .csv or .tsv file is altered so that a record contains malicious code. The // record begins with a special character, such as =, +, -, or @. When the file is // opened in a spreadsheet program, the program might interpret the record as a // formula and run the code within it. Before you download an input file from // Amazon S3, ensure that you recognize the file and trust its creator. // // This member is required. Location *string // The repository type for the custom terminology data. // // This member is required. RepositoryType *string noSmithyDocumentSerde } // The properties of the custom terminology. type TerminologyProperties struct { // The Amazon Resource Name (ARN) of the custom terminology. Arn *string // The time at which the custom terminology was created, based on the timestamp. CreatedAt *time.Time // The description of the custom terminology properties. Description *string // The directionality of your terminology resource indicates whether it has one // source language (uni-directional) or multiple (multi-directional). UNI The // terminology resource has one source language (the first column in a CSV file), // and all of its other languages are target languages. MULTI Any language in the // terminology resource can be the source language. Directionality Directionality // The encryption key for the custom terminology. EncryptionKey *EncryptionKey // The format of the custom terminology input file. Format TerminologyDataFormat // The time at which the custom terminology was last update, based on the // timestamp. LastUpdatedAt *time.Time // Additional information from Amazon Translate about the terminology resource. Message *string // The name of the custom terminology. Name *string // The size of the file used when importing a custom terminology. SizeBytes *int32 // The number of terms in the input file that Amazon Translate skipped when you // created or updated the terminology resource. SkippedTermCount *int32 // The language code for the source text of the translation request for which the // custom terminology is being used. SourceLanguageCode *string // The language codes for the target languages available with the custom // terminology resource. All possible target languages are returned in array. TargetLanguageCodes []string // The number of terms included in the custom terminology. TermCount *int32 noSmithyDocumentSerde } // Provides information for filtering a list of translation jobs. For more // information, see ListTextTranslationJobs . type TextTranslationJobFilter struct { // Filters the list of jobs by name. JobName *string // Filters the list of jobs based by job status. JobStatus JobStatus // Filters the list of jobs based on the time that the job was submitted for // processing and returns only the jobs submitted after the specified time. Jobs // are returned in descending order, newest to oldest. SubmittedAfterTime *time.Time // Filters the list of jobs based on the time that the job was submitted for // processing and returns only the jobs submitted before the specified time. Jobs // are returned in ascending order, oldest to newest. SubmittedBeforeTime *time.Time noSmithyDocumentSerde } // Provides information about a translation job. type TextTranslationJobProperties struct { // The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) // role that granted Amazon Translate read access to the job's input data. DataAccessRoleArn *string // The time at which the translation job ended. EndTime *time.Time // The input configuration properties that were specified when the job was // requested. InputDataConfig *InputDataConfig // The number of documents successfully and unsuccessfully processed during the // translation job. JobDetails *JobDetails // The ID of the translation job. JobId *string // The user-defined name of the translation job. JobName *string // The status of the translation job. JobStatus JobStatus // An explanation of any errors that may have occurred during the translation job. Message *string // The output configuration properties that were specified when the job was // requested. OutputDataConfig *OutputDataConfig // A list containing the names of the parallel data resources applied to the // translation job. ParallelDataNames []string // Settings that modify the translation output. Settings *TranslationSettings // The language code of the language of the source text. The language must be a // language supported by Amazon Translate. SourceLanguageCode *string // The time at which the translation job was submitted. SubmittedTime *time.Time // The language code of the language of the target text. The language must be a // language supported by Amazon Translate. TargetLanguageCodes []string // A list containing the names of the terminologies applied to a translation job. // Only one terminology can be applied per StartTextTranslationJob request at this // time. TerminologyNames []string noSmithyDocumentSerde } // The translated content. type TranslatedDocument struct { // The document containing the translated content. // // This member is required. Content []byte noSmithyDocumentSerde } // Settings to configure your translation output, including the option to set the // formality level of the output text and the option to mask profane words and // phrases. type TranslationSettings struct { // You can optionally specify the desired level of formality for translations to // supported target languages. The formality setting controls the level of formal // language usage (also known as register (https://en.wikipedia.org/wiki/Register_(sociolinguistics)) // ) in the translation output. You can set the value to informal or formal. If you // don't specify a value for formality, or if the target language doesn't support // formality, the translation will ignore the formality setting. If you specify // multiple target languages for the job, translate ignores the formality setting // for any unsupported target language. For a list of target languages that support // formality, see Supported languages (https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-formality.html#customizing-translations-formality-languages) // in the Amazon Translate Developer Guide. Formality Formality // Enable the profanity setting if you want Amazon Translate to mask profane words // and phrases in your translation output. To mask profane words and phrases, // Amazon Translate replaces them with the grawlix string “?$#@$“. This // 5-character sequence is used for each profane word or phrase, regardless of the // length or number of words. Amazon Translate doesn't detect profanity in all of // its supported languages. For languages that don't support profanity detection, // see Unsupported languages (https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-profanity.html#customizing-translations-profanity-languages) // in the Amazon Translate Developer Guide. If you specify multiple target // languages for the job, all the target languages must support profanity masking. // If any of the target languages don't support profanity masking, the translation // job won't mask profanity for any target language. Profanity Profanity noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
531
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions import ( "context" cryptorand "crypto/rand" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "VerifiedPermissions" const ServiceAPIVersion = "2021-12-01" // Client provides the API client to make operations call for Amazon Verified // Permissions. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) resolveIdempotencyTokenProvider(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "verifiedpermissions", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
455
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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 verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a reference to an Amazon Cognito user pool as an external identity // provider (IdP). After you create an identity source, you can use the identities // provided by the IdP as proxies for the principal in authorization queries that // use the IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operation. These identities take the form of tokens that contain claims about // the user, such as IDs, attributes and group memberships. Amazon Cognito provides // both identity tokens and access tokens, and Verified Permissions can use either // or both. Any combination of identity and access tokens results in the same Cedar // principal. Verified Permissions automatically translates the information about // the identities into the standard Cedar attributes that can be evaluated by your // policies. Because the Amazon Cognito identity and access tokens can contain // different information, the tokens you choose to use determine which principal // attributes are available to access when evaluating Cedar policies. If you delete // a Amazon Cognito user pool or user, tokens from that deleted pool or that // deleted user continue to be usable until they expire. To reference a user from // this identity source in your Cedar policies, use the following syntax. // IdentityType::"<CognitoUserPoolIdentifier>|<CognitoClientId> Where IdentityType // is the string that you provide to the PrincipalEntityType parameter for this // operation. The CognitoUserPoolId and CognitoClientId are defined by the Amazon // Cognito user pool. func (c *Client) CreateIdentitySource(ctx context.Context, params *CreateIdentitySourceInput, optFns ...func(*Options)) (*CreateIdentitySourceOutput, error) { if params == nil { params = &CreateIdentitySourceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateIdentitySource", params, optFns, c.addOperationCreateIdentitySourceMiddlewares) if err != nil { return nil, err } out := result.(*CreateIdentitySourceOutput) out.ResultMetadata = metadata return out, nil } type CreateIdentitySourceInput struct { // Specifies the details required to communicate with the identity provider (IdP) // associated with this identity source. At this time, the only valid member of // this structure is a Amazon Cognito user pool configuration. You must specify a // UserPoolArn , and optionally, a ClientId . // // This member is required. Configuration types.Configuration // Specifies the ID of the policy store in which you want to store this identity // source. Only policies and requests made using this policy store can reference // identities from the identity provider configured in the new identity source. // // This member is required. PolicyStoreId *string // Specifies a unique, case-sensitive ID that you provide to ensure the // idempotency of the request. This lets you safely retry the request without // accidentally performing the same operation a second time. Passing the same value // to a later call to an operation requires that you also pass the same value for // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier) // . If you don't provide this value, then Amazon Web Services generates a random // one for you. If you retry the operation with the same ClientToken , but with // different parameters, the retry fails with an IdempotentParameterMismatch error. ClientToken *string // Specifies the namespace and data type of the principals generated for // identities authenticated by the new identity source. PrincipalEntityType *string noSmithyDocumentSerde } type CreateIdentitySourceOutput struct { // The date and time the identity source was originally created. // // This member is required. CreatedDate *time.Time // The unique ID of the new identity source. // // This member is required. IdentitySourceId *string // The date and time the identity source was most recently updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store that contains the identity source. // // This member is required. PolicyStoreId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateIdentitySource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateIdentitySource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateIdentitySourceMiddleware(stack, options); err != nil { return err } if err = addOpCreateIdentitySourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIdentitySource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateIdentitySource struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateIdentitySource) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateIdentitySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateIdentitySourceInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIdentitySourceInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateIdentitySourceMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIdentitySource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "CreateIdentitySource", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a Cedar policy and saves it in the specified policy store. You can // create either a static policy or a policy linked to a policy template. // - To create a static policy, provide the Cedar policy text in the StaticPolicy // section of the PolicyDefinition . // - To create a policy that is dynamically linked to a policy template, specify // the policy template ID and the principal and resource to associate with this // policy in the templateLinked section of the PolicyDefinition . If the policy // template is ever updated, any policies linked to the policy template // automatically use the updated template. // // Creating a policy causes it to be validated against the schema in the policy // store. If the policy doesn't pass validation, the operation fails and the policy // isn't stored. 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 { // A structure that specifies the policy type and content to use for the new // policy. You must include either a static or a templateLinked element. The policy // content must be written in the Cedar policy language. // // This member is required. Definition types.PolicyDefinition // Specifies the PolicyStoreId of the policy store you want to store the policy in. // // This member is required. PolicyStoreId *string // Specifies a unique, case-sensitive ID that you provide to ensure the // idempotency of the request. This lets you safely retry the request without // accidentally performing the same operation a second time. Passing the same value // to a later call to an operation requires that you also pass the same value for // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier) // . If you don't provide this value, then Amazon Web Services generates a random // one for you. If you retry the operation with the same ClientToken , but with // different parameters, the retry fails with an IdempotentParameterMismatch error. ClientToken *string noSmithyDocumentSerde } type CreatePolicyOutput struct { // The date and time the policy was originally created. // // This member is required. CreatedDate *time.Time // The date and time the policy was last updated. // // This member is required. LastUpdatedDate *time.Time // The unique ID of the new policy. // // This member is required. PolicyId *string // The ID of the policy store that contains the new policy. // // This member is required. PolicyStoreId *string // The policy type of the new policy. // // This member is required. PolicyType types.PolicyType // The principal specified in the new policy's scope. This response element isn't // present when principal isn't specified in the policy content. Principal *types.EntityIdentifier // The resource specified in the new policy's scope. This response element isn't // present when the resource isn't specified in the policy content. Resource *types.EntityIdentifier // 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(&awsAwsjson10_serializeOpCreatePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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 = addIdempotencyToken_opCreatePolicyMiddleware(stack, options); 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 } type idempotencyToken_initializeOpCreatePolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreatePolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreatePolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreatePolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "CreatePolicy", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a policy store. A policy store is a container for policy resources. // Although Cedar supports multiple namespaces (https://docs.cedarpolicy.com/schema.html#namespace) // , Verified Permissions currently supports only one namespace per policy store. func (c *Client) CreatePolicyStore(ctx context.Context, params *CreatePolicyStoreInput, optFns ...func(*Options)) (*CreatePolicyStoreOutput, error) { if params == nil { params = &CreatePolicyStoreInput{} } result, metadata, err := c.invokeOperation(ctx, "CreatePolicyStore", params, optFns, c.addOperationCreatePolicyStoreMiddlewares) if err != nil { return nil, err } out := result.(*CreatePolicyStoreOutput) out.ResultMetadata = metadata return out, nil } type CreatePolicyStoreInput struct { // Specifies the validation setting for this policy store. Currently, the only // valid and required value is Mode . We recommend that you turn on STRICT mode // only after you define a schema. If a schema doesn't exist, then STRICT mode // causes any policy to fail validation, and Verified Permissions rejects the // policy. You can turn off validation by using the UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) // . Then, when you have a schema defined, use UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) // again to turn validation back on. // // This member is required. ValidationSettings *types.ValidationSettings // Specifies a unique, case-sensitive ID that you provide to ensure the // idempotency of the request. This lets you safely retry the request without // accidentally performing the same operation a second time. Passing the same value // to a later call to an operation requires that you also pass the same value for // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier) // . If you don't provide this value, then Amazon Web Services generates a random // one for you. If you retry the operation with the same ClientToken , but with // different parameters, the retry fails with an IdempotentParameterMismatch error. ClientToken *string noSmithyDocumentSerde } type CreatePolicyStoreOutput struct { // The Amazon Resource Name (ARN) of the new policy store. // // This member is required. Arn *string // The date and time the policy store was originally created. // // This member is required. CreatedDate *time.Time // The date and time the policy store was last updated. // // This member is required. LastUpdatedDate *time.Time // The unique ID of the new policy store. // // This member is required. PolicyStoreId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreatePolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreatePolicyStore{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreatePolicyStore{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreatePolicyStoreMiddleware(stack, options); err != nil { return err } if err = addOpCreatePolicyStoreValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicyStore(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreatePolicyStore struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreatePolicyStore) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreatePolicyStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreatePolicyStoreInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyStoreInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreatePolicyStoreMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicyStore{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreatePolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "CreatePolicyStore", } }
198
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a policy template. A template can use placeholders for the principal // and resource. A template must be instantiated into a policy by associating it // with specific principals and resources to use for the placeholders. That // instantiated policy can then be considered in authorization decisions. The // instantiated policy works identically to any other policy, except that it is // dynamically linked to the template. If the template changes, then any policies // that are linked to that template are immediately updated as well. func (c *Client) CreatePolicyTemplate(ctx context.Context, params *CreatePolicyTemplateInput, optFns ...func(*Options)) (*CreatePolicyTemplateOutput, error) { if params == nil { params = &CreatePolicyTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "CreatePolicyTemplate", params, optFns, c.addOperationCreatePolicyTemplateMiddlewares) if err != nil { return nil, err } out := result.(*CreatePolicyTemplateOutput) out.ResultMetadata = metadata return out, nil } type CreatePolicyTemplateInput struct { // The ID of the policy store in which to create the policy template. // // This member is required. PolicyStoreId *string // Specifies the content that you want to use for the new policy template, written // in the Cedar policy language. // // This member is required. Statement *string // Specifies a unique, case-sensitive ID that you provide to ensure the // idempotency of the request. This lets you safely retry the request without // accidentally performing the same operation a second time. Passing the same value // to a later call to an operation requires that you also pass the same value for // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier) // . If you don't provide this value, then Amazon Web Services generates a random // one for you. If you retry the operation with the same ClientToken , but with // different parameters, the retry fails with an IdempotentParameterMismatch error. ClientToken *string // Specifies a description for the policy template. Description *string noSmithyDocumentSerde } type CreatePolicyTemplateOutput struct { // The date and time the policy template was originally created. // // This member is required. CreatedDate *time.Time // The date and time the policy template was most recently updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store that contains the policy template. // // This member is required. PolicyStoreId *string // The unique ID of the new policy template. // // This member is required. PolicyTemplateId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreatePolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreatePolicyTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreatePolicyTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreatePolicyTemplateMiddleware(stack, options); err != nil { return err } if err = addOpCreatePolicyTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicyTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreatePolicyTemplate struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreatePolicyTemplate) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreatePolicyTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreatePolicyTemplateInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePolicyTemplateInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreatePolicyTemplateMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePolicyTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreatePolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "CreatePolicyTemplate", } }
204
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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 identity source that references an identity provider (IdP) such as // Amazon Cognito. After you delete the identity source, you can no longer use // tokens for identities from that identity source to represent principals in // authorization queries made using IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // . operations. func (c *Client) DeleteIdentitySource(ctx context.Context, params *DeleteIdentitySourceInput, optFns ...func(*Options)) (*DeleteIdentitySourceOutput, error) { if params == nil { params = &DeleteIdentitySourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteIdentitySource", params, optFns, c.addOperationDeleteIdentitySourceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteIdentitySourceOutput) out.ResultMetadata = metadata return out, nil } type DeleteIdentitySourceInput struct { // Specifies the ID of the identity source that you want to delete. // // This member is required. IdentitySourceId *string // Specifies the ID of the policy store that contains the identity source that you // want to delete. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type DeleteIdentitySourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteIdentitySource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteIdentitySource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteIdentitySourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentitySource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "DeleteIdentitySource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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 the policy store. This operation is // idempotent; if you specify a policy that doesn't exist, the request response // returns a successful HTTP 200 status code. 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 { // Specifies the ID of the policy that you want to delete. // // This member is required. PolicyId *string // Specifies the ID of the policy store that contains the policy that you want to // delete. // // This member is required. PolicyStoreId *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(&awsAwsjson10_serializeOpDeletePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "verifiedpermissions", OperationName: "DeletePolicy", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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 store. This operation is idempotent. If you // specify a policy store that does not exist, the request response will still // return a successful HTTP 200 status code. func (c *Client) DeletePolicyStore(ctx context.Context, params *DeletePolicyStoreInput, optFns ...func(*Options)) (*DeletePolicyStoreOutput, error) { if params == nil { params = &DeletePolicyStoreInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePolicyStore", params, optFns, c.addOperationDeletePolicyStoreMiddlewares) if err != nil { return nil, err } out := result.(*DeletePolicyStoreOutput) out.ResultMetadata = metadata return out, nil } type DeletePolicyStoreInput struct { // Specifies the ID of the policy store that you want to delete. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type DeletePolicyStoreOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeletePolicyStore{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeletePolicyStore{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeletePolicyStoreValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicyStore(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeletePolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "DeletePolicyStore", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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 template from the policy store. This operation // also deletes any policies that were created from the specified policy template. // Those policies are immediately removed from all future API responses, and are // asynchronously deleted from the policy store. func (c *Client) DeletePolicyTemplate(ctx context.Context, params *DeletePolicyTemplateInput, optFns ...func(*Options)) (*DeletePolicyTemplateOutput, error) { if params == nil { params = &DeletePolicyTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePolicyTemplate", params, optFns, c.addOperationDeletePolicyTemplateMiddlewares) if err != nil { return nil, err } out := result.(*DeletePolicyTemplateOutput) out.ResultMetadata = metadata return out, nil } type DeletePolicyTemplateInput struct { // Specifies the ID of the policy store that contains the policy template that you // want to delete. // // This member is required. PolicyStoreId *string // Specifies the ID of the policy template that you want to delete. // // This member is required. PolicyTemplateId *string noSmithyDocumentSerde } type DeletePolicyTemplateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeletePolicyTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeletePolicyTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeletePolicyTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicyTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeletePolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "DeletePolicyTemplate", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the details about the specified identity source. func (c *Client) GetIdentitySource(ctx context.Context, params *GetIdentitySourceInput, optFns ...func(*Options)) (*GetIdentitySourceOutput, error) { if params == nil { params = &GetIdentitySourceInput{} } result, metadata, err := c.invokeOperation(ctx, "GetIdentitySource", params, optFns, c.addOperationGetIdentitySourceMiddlewares) if err != nil { return nil, err } out := result.(*GetIdentitySourceOutput) out.ResultMetadata = metadata return out, nil } type GetIdentitySourceInput struct { // Specifies the ID of the identity source you want information about. // // This member is required. IdentitySourceId *string // Specifies the ID of the policy store that contains the identity source you want // information about. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type GetIdentitySourceOutput struct { // The date and time that the identity source was originally created. // // This member is required. CreatedDate *time.Time // A structure that describes the configuration of the identity source. // // This member is required. Details *types.IdentitySourceDetails // The ID of the identity source. // // This member is required. IdentitySourceId *string // The date and time that the identity source was most recently updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store that contains the identity source. // // This member is required. PolicyStoreId *string // The data type of principals generated for identities authenticated by this // identity source. // // This member is required. PrincipalEntityType *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetIdentitySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetIdentitySource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetIdentitySource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetIdentitySourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentitySource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetIdentitySource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "GetIdentitySource", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves information about the specified policy. func (c *Client) GetPolicy(ctx context.Context, params *GetPolicyInput, optFns ...func(*Options)) (*GetPolicyOutput, error) { if params == nil { params = &GetPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPolicy", params, optFns, c.addOperationGetPolicyMiddlewares) if err != nil { return nil, err } out := result.(*GetPolicyOutput) out.ResultMetadata = metadata return out, nil } type GetPolicyInput struct { // Specifies the ID of the policy you want information about. // // This member is required. PolicyId *string // Specifies the ID of the policy store that contains the policy that you want // information about. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type GetPolicyOutput struct { // The date and time that the policy was originally created. // // This member is required. CreatedDate *time.Time // The definition of the requested policy. // // This member is required. Definition types.PolicyDefinitionDetail // The date and time that the policy was last updated. // // This member is required. LastUpdatedDate *time.Time // The unique ID of the policy that you want information about. // // This member is required. PolicyId *string // The ID of the policy store that contains the policy that you want information // about. // // This member is required. PolicyStoreId *string // The type of the policy. // // This member is required. PolicyType types.PolicyType // The principal specified in the policy's scope. This element isn't included in // the response when Principal isn't present in the policy content. Principal *types.EntityIdentifier // The resource specified in the policy's scope. This element isn't included in // the response when Resource isn't present in the policy content. Resource *types.EntityIdentifier // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "GetPolicy", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves details about a policy store. func (c *Client) GetPolicyStore(ctx context.Context, params *GetPolicyStoreInput, optFns ...func(*Options)) (*GetPolicyStoreOutput, error) { if params == nil { params = &GetPolicyStoreInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPolicyStore", params, optFns, c.addOperationGetPolicyStoreMiddlewares) if err != nil { return nil, err } out := result.(*GetPolicyStoreOutput) out.ResultMetadata = metadata return out, nil } type GetPolicyStoreInput struct { // Specifies the ID of the policy store that you want information about. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type GetPolicyStoreOutput struct { // The Amazon Resource Name (ARN) of the policy store. // // This member is required. Arn *string // The date and time that the policy store was originally created. // // This member is required. CreatedDate *time.Time // The date and time that the policy store was last updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store; // // This member is required. PolicyStoreId *string // The current validation settings for the policy store. // // This member is required. ValidationSettings *types.ValidationSettings // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPolicyStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicyStore{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicyStore{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPolicyStoreValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicyStore(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPolicyStore(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "GetPolicyStore", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieve the details for the specified policy template in the specified policy // store. func (c *Client) GetPolicyTemplate(ctx context.Context, params *GetPolicyTemplateInput, optFns ...func(*Options)) (*GetPolicyTemplateOutput, error) { if params == nil { params = &GetPolicyTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPolicyTemplate", params, optFns, c.addOperationGetPolicyTemplateMiddlewares) if err != nil { return nil, err } out := result.(*GetPolicyTemplateOutput) out.ResultMetadata = metadata return out, nil } type GetPolicyTemplateInput struct { // Specifies the ID of the policy store that contains the policy template that you // want information about. // // This member is required. PolicyStoreId *string // Specifies the ID of the policy template that you want information about. // // This member is required. PolicyTemplateId *string noSmithyDocumentSerde } type GetPolicyTemplateOutput struct { // The date and time that the policy template was originally created. // // This member is required. CreatedDate *time.Time // The date and time that the policy template was most recently updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store that contains the policy template. // // This member is required. PolicyStoreId *string // The ID of the policy template. // // This member is required. PolicyTemplateId *string // The content of the body of the policy template written in the Cedar policy // language. // // This member is required. Statement *string // The description of the policy template. Description *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPolicyTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPolicyTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPolicyTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPolicyTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPolicyTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPolicyTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "GetPolicyTemplate", } }
158
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieve the details for the specified schema in the specified policy store. func (c *Client) GetSchema(ctx context.Context, params *GetSchemaInput, optFns ...func(*Options)) (*GetSchemaOutput, error) { if params == nil { params = &GetSchemaInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSchema", params, optFns, c.addOperationGetSchemaMiddlewares) if err != nil { return nil, err } out := result.(*GetSchemaOutput) out.ResultMetadata = metadata return out, nil } type GetSchemaInput struct { // Specifies the ID of the policy store that contains the schema. // // This member is required. PolicyStoreId *string noSmithyDocumentSerde } type GetSchemaOutput struct { // The date and time that the schema was originally created. // // This member is required. CreatedDate *time.Time // The date and time that the schema was most recently updated. // // This member is required. LastUpdatedDate *time.Time // The ID of the policy store that contains the schema. // // This member is required. PolicyStoreId *string // The body of the schema, written in Cedar schema JSON. // // This member is required. Schema *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSchemaMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSchema{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSchema{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetSchemaValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSchema(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetSchema(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "GetSchema", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Makes an authorization decision about a service request described in the // parameters. The information in the parameters can also define additional context // that Verified Permissions can include in the evaluation. The request is // evaluated against all matching policies in the specified policy store. The // result of the decision is either Allow or Deny , along with a list of the // policies that resulted in the decision. func (c *Client) IsAuthorized(ctx context.Context, params *IsAuthorizedInput, optFns ...func(*Options)) (*IsAuthorizedOutput, error) { if params == nil { params = &IsAuthorizedInput{} } result, metadata, err := c.invokeOperation(ctx, "IsAuthorized", params, optFns, c.addOperationIsAuthorizedMiddlewares) if err != nil { return nil, err } out := result.(*IsAuthorizedOutput) out.ResultMetadata = metadata return out, nil } type IsAuthorizedInput struct { // Specifies the ID of the policy store. Policies in this policy store will be // used to make an authorization decision for the input. // // This member is required. PolicyStoreId *string // Specifies the requested action to be authorized. For example, is the principal // authorized to perform this action on the resource? Action *types.ActionIdentifier // Specifies additional context that can be used to make more granular // authorization decisions. Context types.ContextDefinition // Specifies the list of resources and principals and their associated attributes // that Verified Permissions can examine when evaluating the policies. You can // include only principal and resource entities in this parameter; you can't // include actions. You must specify actions in the schema. Entities types.EntitiesDefinition // Specifies the principal for which the authorization decision is to be made. Principal *types.EntityIdentifier // Specifies the resource for which the authorization decision is to be made. Resource *types.EntityIdentifier noSmithyDocumentSerde } type IsAuthorizedOutput struct { // An authorization decision that indicates if the authorization request should be // allowed or denied. // // This member is required. Decision types.Decision // The list of determining policies used to make the authorization decision. For // example, if there are two matching policies, where one is a forbid and the other // is a permit, then the forbid policy will be the determining policy. In the case // of multiple matching permit policies then there would be multiple determining // policies. In the case that no policies match, and hence the response is DENY, // there would be no determining policies. // // This member is required. DeterminingPolicies []types.DeterminingPolicyItem // Errors that occurred while making an authorization decision, for example, a // policy references an Entity or entity Attribute that does not exist in the // slice. // // This member is required. Errors []types.EvaluationErrorItem // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationIsAuthorizedMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpIsAuthorized{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpIsAuthorized{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpIsAuthorizedValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opIsAuthorized(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opIsAuthorized(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "IsAuthorized", } }
171
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Makes an authorization decision about a service request described in the // parameters. The principal in this request comes from an external identity // source. The information in the parameters can also define additional context // that Verified Permissions can include in the evaluation. The request is // evaluated against all matching policies in the specified policy store. The // result of the decision is either Allow or Deny , along with a list of the // policies that resulted in the decision. If you delete a Amazon Cognito user pool // or user, tokens from that deleted pool or that deleted user continue to be // usable until they expire. func (c *Client) IsAuthorizedWithToken(ctx context.Context, params *IsAuthorizedWithTokenInput, optFns ...func(*Options)) (*IsAuthorizedWithTokenOutput, error) { if params == nil { params = &IsAuthorizedWithTokenInput{} } result, metadata, err := c.invokeOperation(ctx, "IsAuthorizedWithToken", params, optFns, c.addOperationIsAuthorizedWithTokenMiddlewares) if err != nil { return nil, err } out := result.(*IsAuthorizedWithTokenOutput) out.ResultMetadata = metadata return out, nil } type IsAuthorizedWithTokenInput struct { // Specifies the ID of the policy store. Policies in this policy store will be // used to make an authorization decision for the input. // // This member is required. PolicyStoreId *string // Specifies an access token for the principal to be authorized. This token is // provided to you by the identity provider (IdP) associated with the specified // identity source. You must specify either an AccessToken or an IdentityToken , // but not both. AccessToken *string // Specifies the requested action to be authorized. Is the specified principal // authorized to perform this action on the specified resource. Action *types.ActionIdentifier // Specifies additional context that can be used to make more granular // authorization decisions. Context types.ContextDefinition // Specifies the list of resources and principals and their associated attributes // that Verified Permissions can examine when evaluating the policies. You can // include only principal and resource entities in this parameter; you can't // include actions. You must specify actions in the schema. Entities types.EntitiesDefinition // Specifies an identity token for the principal to be authorized. This token is // provided to you by the identity provider (IdP) associated with the specified // identity source. You must specify either an AccessToken or an IdentityToken , // but not both. IdentityToken *string // Specifies the resource for which the authorization decision is made. For // example, is the principal allowed to perform the action on the resource? Resource *types.EntityIdentifier noSmithyDocumentSerde } type IsAuthorizedWithTokenOutput struct { // An authorization decision that indicates if the authorization request should be // allowed or denied. // // This member is required. Decision types.Decision // The list of determining policies used to make the authorization decision. For // example, if there are multiple matching policies, where at least one is a forbid // policy, then because forbid always overrides permit the forbid policies are the // determining policies. If all matching policies are permit policies, then those // policies are the determining policies. When no policies match and the response // is the default DENY, there are no determining policies. // // This member is required. DeterminingPolicies []types.DeterminingPolicyItem // Errors that occurred while making an authorization decision. For example, a // policy references an entity or entity attribute that does not exist in the // slice. // // This member is required. Errors []types.EvaluationErrorItem // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationIsAuthorizedWithTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpIsAuthorizedWithToken{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpIsAuthorizedWithToken{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpIsAuthorizedWithTokenValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opIsAuthorizedWithToken(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opIsAuthorizedWithToken(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "IsAuthorizedWithToken", } }
184
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package verifiedpermissions 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/verifiedpermissions/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a paginated list of all of the identity sources defined in the // specified policy store. func (c *Client) ListIdentitySources(ctx context.Context, params *ListIdentitySourcesInput, optFns ...func(*Options)) (*ListIdentitySourcesOutput, error) { if params == nil { params = &ListIdentitySourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListIdentitySources", params, optFns, c.addOperationListIdentitySourcesMiddlewares) if err != nil { return nil, err } out := result.(*ListIdentitySourcesOutput) out.ResultMetadata = metadata return out, nil } type ListIdentitySourcesInput struct { // Specifies the ID of the policy store that contains the identity sources that // you want to list. // // This member is required. PolicyStoreId *string // Specifies characteristics of an identity source that you can use to limit the // output to matching identity sources. Filters []types.IdentitySourceFilter // Specifies 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 number you // specify, the NextToken response element is returned with a value (not null). // Include the specified value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that the service // 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 // Specifies that you want to receive the next page of results. Valid only if you // received a NextToken response in the previous request. If you did, it indicates // that more output is available. Set this parameter to the value provided by the // previous call's NextToken response to request the next page of results. NextToken *string noSmithyDocumentSerde } type ListIdentitySourcesOutput struct { // The list of identity sources stored in the specified policy store. // // This member is required. IdentitySources []types.IdentitySourceItem // If present, this value 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 . This // indicates that this is the last page of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListIdentitySourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListIdentitySources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListIdentitySources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListIdentitySourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentitySources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListIdentitySourcesAPIClient is a client that implements the // ListIdentitySources operation. type ListIdentitySourcesAPIClient interface { ListIdentitySources(context.Context, *ListIdentitySourcesInput, ...func(*Options)) (*ListIdentitySourcesOutput, error) } var _ ListIdentitySourcesAPIClient = (*Client)(nil) // ListIdentitySourcesPaginatorOptions is the paginator options for // ListIdentitySources type ListIdentitySourcesPaginatorOptions struct { // Specifies 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 number you // specify, the NextToken response element is returned with a value (not null). // Include the specified value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that the service // 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 } // ListIdentitySourcesPaginator is a paginator for ListIdentitySources type ListIdentitySourcesPaginator struct { options ListIdentitySourcesPaginatorOptions client ListIdentitySourcesAPIClient params *ListIdentitySourcesInput nextToken *string firstPage bool } // NewListIdentitySourcesPaginator returns a new ListIdentitySourcesPaginator func NewListIdentitySourcesPaginator(client ListIdentitySourcesAPIClient, params *ListIdentitySourcesInput, optFns ...func(*ListIdentitySourcesPaginatorOptions)) *ListIdentitySourcesPaginator { if params == nil { params = &ListIdentitySourcesInput{} } options := ListIdentitySourcesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListIdentitySourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListIdentitySourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListIdentitySources page. func (p *ListIdentitySourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentitySourcesOutput, 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.ListIdentitySources(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_opListIdentitySources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "verifiedpermissions", OperationName: "ListIdentitySources", } }
257