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 swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by deciders to get a DecisionTask from the specified decision taskList . A // decision task may be returned for any open workflow execution that is using the // specified task list. The task includes a paginated view of the history of the // workflow execution. The decider should use the workflow type and the history to // determine how to properly handle the task. This action initiates a long poll, // where the service holds the HTTP connection open and responds as soon a task // becomes available. If no decision task is available in the specified task list // before the timeout of 60 seconds expires, an empty result is returned. An empty // result, in this context, means that a DecisionTask is returned, but that the // value of taskToken is an empty string. Deciders should set their client side // socket timeout to at least 70 seconds (10 seconds higher than the timeout). // Because the number of workflow history events for a single workflow execution // might be very large, the result returned might be split up across a number of // pages. To retrieve subsequent pages, make additional calls to // PollForDecisionTask using the nextPageToken returned by the initial call. Note // that you do not call GetWorkflowExecutionHistory with this nextPageToken . // Instead, call PollForDecisionTask again. Access Control You can use IAM // policies to control this action's access to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the taskList.name parameter by using a Condition element with the // swf:taskList.name key to allow the action to access only certain task lists. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) PollForDecisionTask(ctx context.Context, params *PollForDecisionTaskInput, optFns ...func(*Options)) (*PollForDecisionTaskOutput, error) { if params == nil { params = &PollForDecisionTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "PollForDecisionTask", params, optFns, c.addOperationPollForDecisionTaskMiddlewares) if err != nil { return nil, err } out := result.(*PollForDecisionTaskOutput) out.ResultMetadata = metadata return out, nil } type PollForDecisionTaskInput struct { // The name of the domain containing the task lists to poll. // // This member is required. Domain *string // Specifies the task list to poll for decision tasks. The specified string must // not contain a : (colon), / (slash), | (vertical bar), or any control characters // ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. TaskList *types.TaskList // Identity of the decider making the request, which is recorded in the // DecisionTaskStarted event in the workflow history. This enables diagnostic // tracing when problems arise. The form of this identity is user defined. Identity *string // The maximum number of results that are returned per call. Use nextPageToken to // obtain further pages of results. This is an upper limit only; the actual number // of results returned per call may be fewer than the specified maximum. MaximumPageSize int32 // If NextPageToken is returned there are more results available. The value of // NextPageToken is a unique pagination token for each page. Make the call again // using the returned token to retrieve the next page. Keep all other arguments // unchanged. Each pagination token expires after 24 hours. Using an expired // pagination token will return a 400 error: " Specified token has exceeded its // maximum lifetime ". The configured maximumPageSize determines how many results // can be returned in a single call. The nextPageToken returned by this action // cannot be used with GetWorkflowExecutionHistory to get the next page. You must // call PollForDecisionTask again (with the nextPageToken ) to retrieve the next // page of history records. Calling PollForDecisionTask with a nextPageToken // doesn't return a new decision task. NextPageToken *string // When set to true , returns the events in reverse order. By default the results // are returned in ascending order of the eventTimestamp of the events. ReverseOrder bool // When set to true , returns the events with eventTimestamp greater than or equal // to eventTimestamp of the most recent DecisionTaskStarted event. By default, // this parameter is set to false . StartAtPreviousStartedEvent bool noSmithyDocumentSerde } // A structure that represents a decision task. Decision tasks are sent to // deciders in order for them to make decisions. type PollForDecisionTaskOutput struct { // A paginated list of history events of the workflow execution. The decider uses // this during the processing of the decision task. // // This member is required. Events []types.HistoryEvent // The ID of the DecisionTaskStarted event recorded in the history. // // This member is required. StartedEventId int64 // The opaque string used as a handle on the task. This token is used by workers // to communicate progress and response information back to the system about the // task. // // This member is required. TaskToken *string // The workflow execution for which this decision task was created. // // This member is required. WorkflowExecution *types.WorkflowExecution // The type of the workflow execution for which this decision task was created. // // This member is required. WorkflowType *types.WorkflowType // If a NextPageToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in nextPageToken . Keep all other arguments unchanged. The // configured maximumPageSize determines how many results can be returned in a // single call. NextPageToken *string // The ID of the DecisionTaskStarted event of the previous decision task of this // workflow execution that was processed by the decider. This can be used to // determine the events in the history new since the last decision task received by // the decider. PreviousStartedEventId int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPollForDecisionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpPollForDecisionTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPollForDecisionTask{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPollForDecisionTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPollForDecisionTask(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // PollForDecisionTaskAPIClient is a client that implements the // PollForDecisionTask operation. type PollForDecisionTaskAPIClient interface { PollForDecisionTask(context.Context, *PollForDecisionTaskInput, ...func(*Options)) (*PollForDecisionTaskOutput, error) } var _ PollForDecisionTaskAPIClient = (*Client)(nil) // PollForDecisionTaskPaginatorOptions is the paginator options for // PollForDecisionTask type PollForDecisionTaskPaginatorOptions struct { // The maximum number of results that are returned per call. Use nextPageToken to // obtain further pages of results. This is an upper limit only; the actual number // of results returned per call may be fewer than the specified maximum. 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 } // PollForDecisionTaskPaginator is a paginator for PollForDecisionTask type PollForDecisionTaskPaginator struct { options PollForDecisionTaskPaginatorOptions client PollForDecisionTaskAPIClient params *PollForDecisionTaskInput nextToken *string firstPage bool } // NewPollForDecisionTaskPaginator returns a new PollForDecisionTaskPaginator func NewPollForDecisionTaskPaginator(client PollForDecisionTaskAPIClient, params *PollForDecisionTaskInput, optFns ...func(*PollForDecisionTaskPaginatorOptions)) *PollForDecisionTaskPaginator { if params == nil { params = &PollForDecisionTaskInput{} } options := PollForDecisionTaskPaginatorOptions{} if params.MaximumPageSize != 0 { options.Limit = params.MaximumPageSize } for _, fn := range optFns { fn(&options) } return &PollForDecisionTaskPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextPageToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *PollForDecisionTaskPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next PollForDecisionTask page. func (p *PollForDecisionTaskPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PollForDecisionTaskOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextPageToken = p.nextToken params.MaximumPageSize = p.options.Limit result, err := p.client.PollForDecisionTask(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextPageToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opPollForDecisionTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "PollForDecisionTask", } }
323
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by activity workers to report to the service that the ActivityTask // represented by the specified taskToken is still making progress. The worker can // also specify details of the progress, for example percent complete, using the // details parameter. This action can also be used by the worker as a mechanism to // check if cancellation is being requested for the activity task. If a // cancellation is being attempted for the specified task, then the boolean // cancelRequested flag returned by the service is set to true . This action resets // the taskHeartbeatTimeout clock. The taskHeartbeatTimeout is specified in // RegisterActivityType . This action doesn't in itself create an event in the // workflow execution history. However, if the task times out, the workflow // execution history contains a ActivityTaskTimedOut event that contains the // information from the last heartbeat generated by the activity worker. The // taskStartToCloseTimeout of an activity type is the maximum duration of an // activity task, regardless of the number of RecordActivityTaskHeartbeat requests // received. The taskStartToCloseTimeout is also specified in RegisterActivityType // . This operation is only useful for long-lived activities to report liveliness // of the task and to determine if a cancellation is being attempted. If the // cancelRequested flag returns true , a cancellation is being attempted. If the // worker can cancel the activity, it should respond with // RespondActivityTaskCanceled . Otherwise, it should ignore the cancellation // request. Access Control You can use IAM policies to control this action's access // to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RecordActivityTaskHeartbeat(ctx context.Context, params *RecordActivityTaskHeartbeatInput, optFns ...func(*Options)) (*RecordActivityTaskHeartbeatOutput, error) { if params == nil { params = &RecordActivityTaskHeartbeatInput{} } result, metadata, err := c.invokeOperation(ctx, "RecordActivityTaskHeartbeat", params, optFns, c.addOperationRecordActivityTaskHeartbeatMiddlewares) if err != nil { return nil, err } out := result.(*RecordActivityTaskHeartbeatOutput) out.ResultMetadata = metadata return out, nil } type RecordActivityTaskHeartbeatInput struct { // The taskToken of the ActivityTask . taskToken is generated by the service and // should be treated as an opaque value. If the task is passed to another process, // its taskToken must also be passed. This enables it to provide its progress and // respond with results. // // This member is required. TaskToken *string // If specified, contains details about the progress of the task. Details *string noSmithyDocumentSerde } // Status information about an activity task. type RecordActivityTaskHeartbeatOutput struct { // Set to true if cancellation of the task is requested. // // This member is required. CancelRequested bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRecordActivityTaskHeartbeatMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRecordActivityTaskHeartbeat{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRecordActivityTaskHeartbeat{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRecordActivityTaskHeartbeatValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRecordActivityTaskHeartbeat(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRecordActivityTaskHeartbeat(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RecordActivityTaskHeartbeat", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Registers a new activity type along with its configuration settings in the // specified domain. A TypeAlreadyExists fault is returned if the type already // exists in the domain. You cannot change any configuration settings of the type // after its registration, and it must be registered as a new version. Access // Control You can use IAM policies to control this action's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - defaultTaskList.name : String constraint. The key is // swf:defaultTaskList.name . // - name : String constraint. The key is swf:name . // - version : String constraint. The key is swf:version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RegisterActivityType(ctx context.Context, params *RegisterActivityTypeInput, optFns ...func(*Options)) (*RegisterActivityTypeOutput, error) { if params == nil { params = &RegisterActivityTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "RegisterActivityType", params, optFns, c.addOperationRegisterActivityTypeMiddlewares) if err != nil { return nil, err } out := result.(*RegisterActivityTypeOutput) out.ResultMetadata = metadata return out, nil } type RegisterActivityTypeInput struct { // The name of the domain in which this activity is to be registered. // // This member is required. Domain *string // The name of the activity type within the domain. The specified string must not // contain a : (colon), / (slash), | (vertical bar), or any control characters ( // \u0000-\u001f | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. Name *string // The version of the activity type. The activity type consists of the name and // version, the combination of which must be unique within the domain. The // specified string must not contain a : (colon), / (slash), | (vertical bar), or // any control characters ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be // the literal string arn . // // This member is required. Version *string // If set, specifies the default maximum time before which a worker processing a // task of this type must report progress by calling RecordActivityTaskHeartbeat . // If the timeout is exceeded, the activity task is automatically timed out. This // default can be overridden when scheduling an activity task using the // ScheduleActivityTask Decision . If the activity worker subsequently attempts to // record a heartbeat or returns a result, the activity worker receives an // UnknownResource fault. In this case, Amazon SWF no longer considers the activity // task to be valid; the activity worker should clean up the activity task. The // duration is specified in seconds, an integer greater than or equal to 0 . You // can use NONE to specify unlimited duration. DefaultTaskHeartbeatTimeout *string // If set, specifies the default task list to use for scheduling tasks of this // activity type. This default task list is used if a task list isn't provided when // a task is scheduled through the ScheduleActivityTask Decision . DefaultTaskList *types.TaskList // The default task priority to assign to the activity type. If not assigned, then // 0 is used. Valid values are integers that range from Java's Integer.MIN_VALUE // (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher // priority. For more information about setting task priority, see Setting Task // Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the in the Amazon SWF Developer Guide.. DefaultTaskPriority *string // If set, specifies the default maximum duration for a task of this activity // type. This default can be overridden when scheduling an activity task using the // ScheduleActivityTask Decision . The duration is specified in seconds, an integer // greater than or equal to 0 . You can use NONE to specify unlimited duration. DefaultTaskScheduleToCloseTimeout *string // If set, specifies the default maximum duration that a task of this activity // type can wait before being assigned to a worker. This default can be overridden // when scheduling an activity task using the ScheduleActivityTask Decision . The // duration is specified in seconds, an integer greater than or equal to 0 . You // can use NONE to specify unlimited duration. DefaultTaskScheduleToStartTimeout *string // If set, specifies the default maximum duration that a worker can take to // process tasks of this activity type. This default can be overridden when // scheduling an activity task using the ScheduleActivityTask Decision . The // duration is specified in seconds, an integer greater than or equal to 0 . You // can use NONE to specify unlimited duration. DefaultTaskStartToCloseTimeout *string // A textual description of the activity type. Description *string noSmithyDocumentSerde } type RegisterActivityTypeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRegisterActivityTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRegisterActivityType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRegisterActivityType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRegisterActivityTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterActivityType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRegisterActivityType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RegisterActivityType", } }
206
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Registers a new domain. Access Control You can use IAM policies to control this // action's access to Amazon SWF resources as follows: // // - You cannot use an IAM policy to control domain access for this action. The // name of the domain being registered is available as the resource of this action. // // - Use an Action element to allow or deny permission to call this action. // // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RegisterDomain(ctx context.Context, params *RegisterDomainInput, optFns ...func(*Options)) (*RegisterDomainOutput, error) { if params == nil { params = &RegisterDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "RegisterDomain", params, optFns, c.addOperationRegisterDomainMiddlewares) if err != nil { return nil, err } out := result.(*RegisterDomainOutput) out.ResultMetadata = metadata return out, nil } type RegisterDomainInput struct { // Name of the domain to register. The name must be unique in the region that the // domain is registered in. The specified string must not start or end with // whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or // any control characters ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be // the literal string arn . // // This member is required. Name *string // The duration (in days) that records and histories of workflow executions on the // domain should be kept by the service. After the retention period, the workflow // execution isn't available in the results of visibility calls. If you pass the // value NONE or 0 (zero), then the workflow execution history isn't retained. As // soon as the workflow execution completes, the execution record and its history // are deleted. The maximum workflow execution retention period is 90 days. For // more information about Amazon SWF service limits, see: Amazon SWF Service Limits (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-limits.html) // in the Amazon SWF Developer Guide. // // This member is required. WorkflowExecutionRetentionPeriodInDays *string // A text description of the domain. Description *string // Tags to be added when registering a domain. Tags may only contain unicode // letters, digits, whitespace, or these symbols: _ . : / = + - @ . Tags []types.ResourceTag noSmithyDocumentSerde } type RegisterDomainOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRegisterDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRegisterDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRegisterDomain{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRegisterDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDomain(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRegisterDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RegisterDomain", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Registers a new workflow type and its configuration settings in the specified // domain. The retention period for the workflow history is set by the // RegisterDomain action. If the type already exists, then a TypeAlreadyExists // fault is returned. You cannot change the configuration settings of a workflow // type once it is registered and it must be registered as a new version. Access // Control You can use IAM policies to control this action's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - defaultTaskList.name : String constraint. The key is // swf:defaultTaskList.name . // - name : String constraint. The key is swf:name . // - version : String constraint. The key is swf:version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RegisterWorkflowType(ctx context.Context, params *RegisterWorkflowTypeInput, optFns ...func(*Options)) (*RegisterWorkflowTypeOutput, error) { if params == nil { params = &RegisterWorkflowTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "RegisterWorkflowType", params, optFns, c.addOperationRegisterWorkflowTypeMiddlewares) if err != nil { return nil, err } out := result.(*RegisterWorkflowTypeOutput) out.ResultMetadata = metadata return out, nil } type RegisterWorkflowTypeInput struct { // The name of the domain in which to register the workflow type. // // This member is required. Domain *string // The name of the workflow type. The specified string must not contain a : // (colon), / (slash), | (vertical bar), or any control characters ( \u0000-\u001f // | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. Name *string // The version of the workflow type. The workflow type consists of the name and // version, the combination of which must be unique within the domain. To get a // list of all currently registered workflow types, use the ListWorkflowTypes // action. The specified string must not contain a : (colon), / (slash), | // (vertical bar), or any control characters ( \u0000-\u001f | \u007f-\u009f ). // Also, it must not be the literal string arn . // // This member is required. Version *string // If set, specifies the default policy to use for the child workflow executions // when a workflow execution of this type is terminated, by calling the // TerminateWorkflowExecution action explicitly or due to an expired timeout. This // default can be overridden when starting a workflow execution using the // StartWorkflowExecution action or the StartChildWorkflowExecution Decision . The // supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. DefaultChildPolicy types.ChildPolicy // If set, specifies the default maximum duration for executions of this workflow // type. You can override this default when starting an execution through the // StartWorkflowExecution Action or StartChildWorkflowExecution Decision . The // duration is specified in seconds; an integer greater than or equal to 0. Unlike // some of the other timeout parameters in Amazon SWF, you cannot specify a value // of "NONE" for defaultExecutionStartToCloseTimeout ; there is a one-year max // limit on the time that a workflow execution can run. Exceeding this limit always // causes the workflow execution to time out. DefaultExecutionStartToCloseTimeout *string // The default IAM role attached to this workflow type. Executions of this // workflow type need IAM roles to invoke Lambda functions. If you don't specify an // IAM role when you start this workflow type, the default Lambda role is attached // to the execution. For more information, see // https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html (https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html) // in the Amazon SWF Developer Guide. DefaultLambdaRole *string // If set, specifies the default task list to use for scheduling decision tasks // for executions of this workflow type. This default is used only if a task list // isn't provided when starting the execution through the StartWorkflowExecution // Action or StartChildWorkflowExecution Decision . DefaultTaskList *types.TaskList // The default task priority to assign to the workflow type. If not assigned, then // 0 is used. Valid values are integers that range from Java's Integer.MIN_VALUE // (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher // priority. For more information about setting task priority, see Setting Task // Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. DefaultTaskPriority *string // If set, specifies the default maximum duration of decision tasks for this // workflow type. This default can be overridden when starting a workflow execution // using the StartWorkflowExecution action or the StartChildWorkflowExecution // Decision . The duration is specified in seconds, an integer greater than or // equal to 0 . You can use NONE to specify unlimited duration. DefaultTaskStartToCloseTimeout *string // Textual description of the workflow type. Description *string noSmithyDocumentSerde } type RegisterWorkflowTypeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRegisterWorkflowTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRegisterWorkflowType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRegisterWorkflowType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRegisterWorkflowTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterWorkflowType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRegisterWorkflowType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RegisterWorkflowType", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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" ) // Records a WorkflowExecutionCancelRequested event in the currently running // workflow execution identified by the given domain, workflowId, and runId. This // logically requests the cancellation of the workflow execution as a whole. It is // up to the decider to take appropriate actions when it receives an execution // history with this event. If the runId isn't specified, the // WorkflowExecutionCancelRequested event is recorded in the history of the current // open workflow execution with the specified workflowId in the domain. Because // this action allows the workflow to properly clean up and gracefully close, it // should be used instead of TerminateWorkflowExecution when possible. Access // Control You can use IAM policies to control this action's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RequestCancelWorkflowExecution(ctx context.Context, params *RequestCancelWorkflowExecutionInput, optFns ...func(*Options)) (*RequestCancelWorkflowExecutionOutput, error) { if params == nil { params = &RequestCancelWorkflowExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "RequestCancelWorkflowExecution", params, optFns, c.addOperationRequestCancelWorkflowExecutionMiddlewares) if err != nil { return nil, err } out := result.(*RequestCancelWorkflowExecutionOutput) out.ResultMetadata = metadata return out, nil } type RequestCancelWorkflowExecutionInput struct { // The name of the domain containing the workflow execution to cancel. // // This member is required. Domain *string // The workflowId of the workflow execution to cancel. // // This member is required. WorkflowId *string // The runId of the workflow execution to cancel. RunId *string noSmithyDocumentSerde } type RequestCancelWorkflowExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRequestCancelWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRequestCancelWorkflowExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRequestCancelWorkflowExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRequestCancelWorkflowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRequestCancelWorkflowExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRequestCancelWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RequestCancelWorkflowExecution", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by workers to tell the service that the ActivityTask identified by the // taskToken was successfully canceled. Additional details can be provided using // the details argument. These details (if provided) appear in the // ActivityTaskCanceled event added to the workflow history. Only use this // operation if the canceled flag of a RecordActivityTaskHeartbeat request returns // true and if the activity can be safely undone or abandoned. A task is considered // open from the time that it is scheduled until it is closed. Therefore a task is // reported as open while a worker is processing it. A task is closed after it has // been specified in a call to RespondActivityTaskCompleted , // RespondActivityTaskCanceled, RespondActivityTaskFailed , or the task has timed // out (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-basic.html#swf-dev-timeout-types) // . Access Control You can use IAM policies to control this action's access to // Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RespondActivityTaskCanceled(ctx context.Context, params *RespondActivityTaskCanceledInput, optFns ...func(*Options)) (*RespondActivityTaskCanceledOutput, error) { if params == nil { params = &RespondActivityTaskCanceledInput{} } result, metadata, err := c.invokeOperation(ctx, "RespondActivityTaskCanceled", params, optFns, c.addOperationRespondActivityTaskCanceledMiddlewares) if err != nil { return nil, err } out := result.(*RespondActivityTaskCanceledOutput) out.ResultMetadata = metadata return out, nil } type RespondActivityTaskCanceledInput struct { // The taskToken of the ActivityTask . taskToken is generated by the service and // should be treated as an opaque value. If the task is passed to another process, // its taskToken must also be passed. This enables it to provide its progress and // respond with results. // // This member is required. TaskToken *string // Information about the cancellation. Details *string noSmithyDocumentSerde } type RespondActivityTaskCanceledOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRespondActivityTaskCanceledMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRespondActivityTaskCanceled{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRespondActivityTaskCanceled{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRespondActivityTaskCanceledValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRespondActivityTaskCanceled(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRespondActivityTaskCanceled(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RespondActivityTaskCanceled", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by workers to tell the service that the ActivityTask identified by the // taskToken completed successfully with a result (if provided). The result // appears in the ActivityTaskCompleted event in the workflow history. If the // requested task doesn't complete successfully, use RespondActivityTaskFailed // instead. If the worker finds that the task is canceled through the canceled // flag returned by RecordActivityTaskHeartbeat , it should cancel the task, clean // up and then call RespondActivityTaskCanceled . A task is considered open from // the time that it is scheduled until it is closed. Therefore a task is reported // as open while a worker is processing it. A task is closed after it has been // specified in a call to RespondActivityTaskCompleted, RespondActivityTaskCanceled // , RespondActivityTaskFailed , or the task has timed out (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-basic.html#swf-dev-timeout-types) // . Access Control You can use IAM policies to control this action's access to // Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RespondActivityTaskCompleted(ctx context.Context, params *RespondActivityTaskCompletedInput, optFns ...func(*Options)) (*RespondActivityTaskCompletedOutput, error) { if params == nil { params = &RespondActivityTaskCompletedInput{} } result, metadata, err := c.invokeOperation(ctx, "RespondActivityTaskCompleted", params, optFns, c.addOperationRespondActivityTaskCompletedMiddlewares) if err != nil { return nil, err } out := result.(*RespondActivityTaskCompletedOutput) out.ResultMetadata = metadata return out, nil } type RespondActivityTaskCompletedInput struct { // The taskToken of the ActivityTask . taskToken is generated by the service and // should be treated as an opaque value. If the task is passed to another process, // its taskToken must also be passed. This enables it to provide its progress and // respond with results. // // This member is required. TaskToken *string // The result of the activity task. It is a free form string that is // implementation specific. Result *string noSmithyDocumentSerde } type RespondActivityTaskCompletedOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRespondActivityTaskCompletedMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRespondActivityTaskCompleted{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRespondActivityTaskCompleted{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRespondActivityTaskCompletedValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRespondActivityTaskCompleted(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRespondActivityTaskCompleted(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RespondActivityTaskCompleted", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by workers to tell the service that the ActivityTask identified by the // taskToken has failed with reason (if specified). The reason and details appear // in the ActivityTaskFailed event added to the workflow history. A task is // considered open from the time that it is scheduled until it is closed. Therefore // a task is reported as open while a worker is processing it. A task is closed // after it has been specified in a call to RespondActivityTaskCompleted , // RespondActivityTaskCanceled , RespondActivityTaskFailed, or the task has timed // out (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-basic.html#swf-dev-timeout-types) // . Access Control You can use IAM policies to control this action's access to // Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RespondActivityTaskFailed(ctx context.Context, params *RespondActivityTaskFailedInput, optFns ...func(*Options)) (*RespondActivityTaskFailedOutput, error) { if params == nil { params = &RespondActivityTaskFailedInput{} } result, metadata, err := c.invokeOperation(ctx, "RespondActivityTaskFailed", params, optFns, c.addOperationRespondActivityTaskFailedMiddlewares) if err != nil { return nil, err } out := result.(*RespondActivityTaskFailedOutput) out.ResultMetadata = metadata return out, nil } type RespondActivityTaskFailedInput struct { // The taskToken of the ActivityTask . taskToken is generated by the service and // should be treated as an opaque value. If the task is passed to another process, // its taskToken must also be passed. This enables it to provide its progress and // respond with results. // // This member is required. TaskToken *string // Detailed information about the failure. Details *string // Description of the error that may assist in diagnostics. Reason *string noSmithyDocumentSerde } type RespondActivityTaskFailedOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRespondActivityTaskFailedMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRespondActivityTaskFailed{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRespondActivityTaskFailed{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRespondActivityTaskFailedValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRespondActivityTaskFailed(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRespondActivityTaskFailed(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RespondActivityTaskFailed", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Used by deciders to tell the service that the DecisionTask identified by the // taskToken has successfully completed. The decisions argument specifies the list // of decisions made while processing the task. A DecisionTaskCompleted event is // added to the workflow history. The executionContext specified is attached to // the event in the workflow execution history. Access Control If an IAM policy // grants permission to use RespondDecisionTaskCompleted , it can express // permissions for the list of decisions in the decisions parameter. Each of the // decisions has one or more parameters, much like a regular API call. To allow for // policies to be as readable as possible, you can express permissions on decisions // as if they were actual API calls, including applying conditions to some // parameters. For more information, see Using IAM to Manage Access to Amazon SWF // Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) RespondDecisionTaskCompleted(ctx context.Context, params *RespondDecisionTaskCompletedInput, optFns ...func(*Options)) (*RespondDecisionTaskCompletedOutput, error) { if params == nil { params = &RespondDecisionTaskCompletedInput{} } result, metadata, err := c.invokeOperation(ctx, "RespondDecisionTaskCompleted", params, optFns, c.addOperationRespondDecisionTaskCompletedMiddlewares) if err != nil { return nil, err } out := result.(*RespondDecisionTaskCompletedOutput) out.ResultMetadata = metadata return out, nil } // Input data for a TaskCompleted response to a decision task. type RespondDecisionTaskCompletedInput struct { // The taskToken from the DecisionTask . taskToken is generated by the service and // should be treated as an opaque value. If the task is passed to another process, // its taskToken must also be passed. This enables it to provide its progress and // respond with results. // // This member is required. TaskToken *string // The list of decisions (possibly empty) made by the decider while processing // this decision task. See the docs for the Decision structure for details. Decisions []types.Decision // User defined context to add to workflow execution. ExecutionContext *string noSmithyDocumentSerde } type RespondDecisionTaskCompletedOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRespondDecisionTaskCompletedMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpRespondDecisionTaskCompleted{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRespondDecisionTaskCompleted{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRespondDecisionTaskCompletedValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRespondDecisionTaskCompleted(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRespondDecisionTaskCompleted(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "RespondDecisionTaskCompleted", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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" ) // Records a WorkflowExecutionSignaled event in the workflow execution history and // creates a decision task for the workflow execution identified by the given // domain, workflowId and runId. The event is recorded with the specified user // defined signalName and input (if provided). If a runId isn't specified, then the // WorkflowExecutionSignaled event is recorded in the history of the current open // workflow with the matching workflowId in the domain. If the specified workflow // execution isn't open, this method fails with UnknownResource . Access Control // You can use IAM policies to control this action's access to Amazon SWF resources // as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) SignalWorkflowExecution(ctx context.Context, params *SignalWorkflowExecutionInput, optFns ...func(*Options)) (*SignalWorkflowExecutionOutput, error) { if params == nil { params = &SignalWorkflowExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "SignalWorkflowExecution", params, optFns, c.addOperationSignalWorkflowExecutionMiddlewares) if err != nil { return nil, err } out := result.(*SignalWorkflowExecutionOutput) out.ResultMetadata = metadata return out, nil } type SignalWorkflowExecutionInput struct { // The name of the domain containing the workflow execution to signal. // // This member is required. Domain *string // The name of the signal. This name must be meaningful to the target workflow. // // This member is required. SignalName *string // The workflowId of the workflow execution to signal. // // This member is required. WorkflowId *string // Data to attach to the WorkflowExecutionSignaled event in the target workflow // execution's history. Input *string // The runId of the workflow execution to signal. RunId *string noSmithyDocumentSerde } type SignalWorkflowExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSignalWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpSignalWorkflowExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSignalWorkflowExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpSignalWorkflowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSignalWorkflowExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opSignalWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "SignalWorkflowExecution", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts an execution of the workflow type in the specified domain using the // provided workflowId and input data. This action returns the newly started // workflow execution. Access Control You can use IAM policies to control this // action's access to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - tagList.member.0 : The key is swf:tagList.member.0 . // - tagList.member.1 : The key is swf:tagList.member.1 . // - tagList.member.2 : The key is swf:tagList.member.2 . // - tagList.member.3 : The key is swf:tagList.member.3 . // - tagList.member.4 : The key is swf:tagList.member.4 . // - taskList : String constraint. The key is swf:taskList.name . // - workflowType.name : String constraint. The key is swf:workflowType.name . // - workflowType.version : String constraint. The key is // swf:workflowType.version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) StartWorkflowExecution(ctx context.Context, params *StartWorkflowExecutionInput, optFns ...func(*Options)) (*StartWorkflowExecutionOutput, error) { if params == nil { params = &StartWorkflowExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "StartWorkflowExecution", params, optFns, c.addOperationStartWorkflowExecutionMiddlewares) if err != nil { return nil, err } out := result.(*StartWorkflowExecutionOutput) out.ResultMetadata = metadata return out, nil } type StartWorkflowExecutionInput struct { // The name of the domain in which the workflow execution is created. The // specified string must not contain a : (colon), / (slash), | (vertical bar), or // any control characters ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be // the literal string arn . // // This member is required. Domain *string // The user defined identifier associated with the workflow execution. You can use // this to associate a custom identifier with the workflow execution. You may // specify the same identifier if a workflow execution is logically a restart of a // previous execution. You cannot have two open workflow executions with the same // workflowId at the same time within the same domain. The specified string must // not contain a : (colon), / (slash), | (vertical bar), or any control characters // ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. WorkflowId *string // The type of the workflow to start. // // This member is required. WorkflowType *types.WorkflowType // If set, specifies the policy to use for the child workflow executions of this // workflow execution if it is terminated, by calling the // TerminateWorkflowExecution action explicitly or due to an expired timeout. This // policy overrides the default child policy specified when registering the // workflow type using RegisterWorkflowType . The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // A child policy for this workflow execution must be specified either as a // default for the workflow type or through this parameter. If neither this // parameter is set nor a default child policy was specified at registration time // then a fault is returned. ChildPolicy types.ChildPolicy // The total duration for this workflow execution. This overrides the // defaultExecutionStartToCloseTimeout specified when registering the workflow // type. The duration is specified in seconds; an integer greater than or equal to // 0 . Exceeding this limit causes the workflow execution to time out. Unlike some // of the other timeout parameters in Amazon SWF, you cannot specify a value of // "NONE" for this timeout; there is a one-year max limit on the time that a // workflow execution can run. An execution start-to-close timeout must be // specified either through this parameter or as a default when the workflow type // is registered. If neither this parameter nor a default execution start-to-close // timeout is specified, a fault is returned. ExecutionStartToCloseTimeout *string // The input for the workflow execution. This is a free form string which should // be meaningful to the workflow you are starting. This input is made available to // the new workflow execution in the WorkflowExecutionStarted history event. Input *string // The IAM role to attach to this workflow execution. Executions of this workflow // type need IAM roles to invoke Lambda functions. If you don't attach an IAM role, // any attempt to schedule a Lambda task fails. This results in a // ScheduleLambdaFunctionFailed history event. For more information, see // https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html (https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html) // in the Amazon SWF Developer Guide. LambdaRole *string // The list of tags to associate with the workflow execution. You can specify a // maximum of 5 tags. You can list workflow executions with a specific tag by // calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and // specifying a TagFilter . TagList []string // The task list to use for the decision tasks generated for this workflow // execution. This overrides the defaultTaskList specified when registering the // workflow type. A task list for this workflow execution must be specified either // as a default for the workflow type or through this parameter. If neither this // parameter is set nor a default task list was specified at registration time then // a fault is returned. The specified string must not contain a : (colon), / // (slash), | (vertical bar), or any control characters ( \u0000-\u001f | // \u007f-\u009f ). Also, it must not be the literal string arn . TaskList *types.TaskList // The task priority to use for this workflow execution. This overrides any // default priority that was assigned when the workflow type was registered. If not // set, then the default task priority for the workflow type is used. Valid values // are integers that range from Java's Integer.MIN_VALUE (-2147483648) to // Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For // more information about setting task priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string // Specifies the maximum duration of decision tasks for this workflow execution. // This parameter overrides the defaultTaskStartToCloseTimout specified when // registering the workflow type using RegisterWorkflowType . The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. A task start-to-close timeout for this workflow // execution must be specified either as a default for the workflow type or through // this parameter. If neither this parameter is set nor a default task // start-to-close timeout was specified at registration time then a fault is // returned. TaskStartToCloseTimeout *string noSmithyDocumentSerde } // Specifies the runId of a workflow execution. type StartWorkflowExecutionOutput struct { // The runId of a workflow execution. This ID is generated by the service and can // be used to uniquely identify the workflow execution within a domain. RunId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartWorkflowExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartWorkflowExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartWorkflowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartWorkflowExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "StartWorkflowExecution", } }
248
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Add a tag to a Amazon SWF domain. Amazon SWF supports a maximum of 50 tags per // resource. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) for the Amazon SWF domain. // // This member is required. ResourceArn *string // The list of tags to add to a domain. Tags may only contain unicode letters, // digits, whitespace, or these symbols: _ . : / = + - @ . // // This member is required. Tags []types.ResourceTag 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(&awsAwsjson10_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "swf", OperationName: "TagResource", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Records a WorkflowExecutionTerminated event and forces closure of the workflow // execution identified by the given domain, runId, and workflowId. The child // policy, registered with the workflow type or specified when starting this // execution, is applied to any open child workflow executions of this workflow // execution. If the identified workflow execution was in progress, it is // terminated immediately. If a runId isn't specified, then the // WorkflowExecutionTerminated event is recorded in the history of the current open // workflow with the matching workflowId in the domain. You should consider using // RequestCancelWorkflowExecution action instead because it allows the workflow to // gracefully close while TerminateWorkflowExecution doesn't. Access Control You // can use IAM policies to control this action's access to Amazon SWF resources as // follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) TerminateWorkflowExecution(ctx context.Context, params *TerminateWorkflowExecutionInput, optFns ...func(*Options)) (*TerminateWorkflowExecutionOutput, error) { if params == nil { params = &TerminateWorkflowExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "TerminateWorkflowExecution", params, optFns, c.addOperationTerminateWorkflowExecutionMiddlewares) if err != nil { return nil, err } out := result.(*TerminateWorkflowExecutionOutput) out.ResultMetadata = metadata return out, nil } type TerminateWorkflowExecutionInput struct { // The domain of the workflow execution to terminate. // // This member is required. Domain *string // The workflowId of the workflow execution to terminate. // // This member is required. WorkflowId *string // If set, specifies the policy to use for the child workflow executions of the // workflow execution being terminated. This policy overrides the child policy // specified for the workflow execution at registration time or when starting the // execution. The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // A child policy for this workflow execution must be specified either as a // default for the workflow type or through this parameter. If neither this // parameter is set nor a default child policy was specified at registration time // then a fault is returned. ChildPolicy types.ChildPolicy // Details for terminating the workflow execution. Details *string // A descriptive reason for terminating the workflow execution. Reason *string // The runId of the workflow execution to terminate. RunId *string noSmithyDocumentSerde } type TerminateWorkflowExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTerminateWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpTerminateWorkflowExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTerminateWorkflowExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTerminateWorkflowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateWorkflowExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTerminateWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "TerminateWorkflowExecution", } }
173
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Undeprecates a previously deprecated activity type. After an activity type has // been undeprecated, you can create new tasks of that activity type. This // operation is eventually consistent. The results are best effort and may not // exactly reflect recent updates and changes. Access Control You can use IAM // policies to control this action's access to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - activityType.name : String constraint. The key is swf:activityType.name . // - activityType.version : String constraint. The key is // swf:activityType.version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) UndeprecateActivityType(ctx context.Context, params *UndeprecateActivityTypeInput, optFns ...func(*Options)) (*UndeprecateActivityTypeOutput, error) { if params == nil { params = &UndeprecateActivityTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "UndeprecateActivityType", params, optFns, c.addOperationUndeprecateActivityTypeMiddlewares) if err != nil { return nil, err } out := result.(*UndeprecateActivityTypeOutput) out.ResultMetadata = metadata return out, nil } type UndeprecateActivityTypeInput struct { // The activity type to undeprecate. // // This member is required. ActivityType *types.ActivityType // The name of the domain of the deprecated activity type. // // This member is required. Domain *string noSmithyDocumentSerde } type UndeprecateActivityTypeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUndeprecateActivityTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUndeprecateActivityType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUndeprecateActivityType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUndeprecateActivityTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUndeprecateActivityType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUndeprecateActivityType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "UndeprecateActivityType", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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" ) // Undeprecates a previously deprecated domain. After a domain has been // undeprecated it can be used to create new workflow executions or register new // types. This operation is eventually consistent. The results are best effort and // may not exactly reflect recent updates and changes. Access Control You can use // IAM policies to control this action's access to Amazon SWF resources as follows: // // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) UndeprecateDomain(ctx context.Context, params *UndeprecateDomainInput, optFns ...func(*Options)) (*UndeprecateDomainOutput, error) { if params == nil { params = &UndeprecateDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "UndeprecateDomain", params, optFns, c.addOperationUndeprecateDomainMiddlewares) if err != nil { return nil, err } out := result.(*UndeprecateDomainOutput) out.ResultMetadata = metadata return out, nil } type UndeprecateDomainInput struct { // The name of the domain of the deprecated workflow type. // // This member is required. Name *string noSmithyDocumentSerde } type UndeprecateDomainOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUndeprecateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUndeprecateDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUndeprecateDomain{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUndeprecateDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUndeprecateDomain(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUndeprecateDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "UndeprecateDomain", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Undeprecates a previously deprecated workflow type. After a workflow type has // been undeprecated, you can create new executions of that type. This operation is // eventually consistent. The results are best effort and may not exactly reflect // recent updates and changes. Access Control You can use IAM policies to control // this action's access to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - workflowType.name : String constraint. The key is swf:workflowType.name . // - workflowType.version : String constraint. The key is // swf:workflowType.version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. func (c *Client) UndeprecateWorkflowType(ctx context.Context, params *UndeprecateWorkflowTypeInput, optFns ...func(*Options)) (*UndeprecateWorkflowTypeOutput, error) { if params == nil { params = &UndeprecateWorkflowTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "UndeprecateWorkflowType", params, optFns, c.addOperationUndeprecateWorkflowTypeMiddlewares) if err != nil { return nil, err } out := result.(*UndeprecateWorkflowTypeOutput) out.ResultMetadata = metadata return out, nil } type UndeprecateWorkflowTypeInput struct { // The name of the domain of the deprecated workflow type. // // This member is required. Domain *string // The name of the domain of the deprecated workflow type. // // This member is required. WorkflowType *types.WorkflowType noSmithyDocumentSerde } type UndeprecateWorkflowTypeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUndeprecateWorkflowTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUndeprecateWorkflowType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUndeprecateWorkflowType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUndeprecateWorkflowTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUndeprecateWorkflowType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUndeprecateWorkflowType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "swf", OperationName: "UndeprecateWorkflowType", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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" ) // Remove a tag from a Amazon SWF domain. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) for the Amazon SWF domain. // // This member is required. ResourceArn *string // The list of tags to remove from the Amazon SWF domain. // // 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(&awsAwsjson10_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "swf", OperationName: "UntagResource", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/swf/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 awsAwsjson10_deserializeOpCountClosedWorkflowExecutions struct { } func (*awsAwsjson10_deserializeOpCountClosedWorkflowExecutions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCountClosedWorkflowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCountClosedWorkflowExecutions(response, &metadata) } output := &CountClosedWorkflowExecutionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCountClosedWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCountClosedWorkflowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCountOpenWorkflowExecutions struct { } func (*awsAwsjson10_deserializeOpCountOpenWorkflowExecutions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCountOpenWorkflowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCountOpenWorkflowExecutions(response, &metadata) } output := &CountOpenWorkflowExecutionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCountOpenWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCountOpenWorkflowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCountPendingActivityTasks struct { } func (*awsAwsjson10_deserializeOpCountPendingActivityTasks) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCountPendingActivityTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCountPendingActivityTasks(response, &metadata) } output := &CountPendingActivityTasksOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCountPendingActivityTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCountPendingActivityTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCountPendingDecisionTasks struct { } func (*awsAwsjson10_deserializeOpCountPendingDecisionTasks) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCountPendingDecisionTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCountPendingDecisionTasks(response, &metadata) } output := &CountPendingDecisionTasksOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCountPendingDecisionTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCountPendingDecisionTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeprecateActivityType struct { } func (*awsAwsjson10_deserializeOpDeprecateActivityType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeprecateActivityType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeprecateActivityType(response, &metadata) } output := &DeprecateActivityTypeOutput{} 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 awsAwsjson10_deserializeOpErrorDeprecateActivityType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeDeprecatedFault", errorCode): return awsAwsjson10_deserializeErrorTypeDeprecatedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeprecateDomain struct { } func (*awsAwsjson10_deserializeOpDeprecateDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeprecateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeprecateDomain(response, &metadata) } output := &DeprecateDomainOutput{} 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 awsAwsjson10_deserializeOpErrorDeprecateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("DomainDeprecatedFault", errorCode): return awsAwsjson10_deserializeErrorDomainDeprecatedFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeprecateWorkflowType struct { } func (*awsAwsjson10_deserializeOpDeprecateWorkflowType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeprecateWorkflowType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeprecateWorkflowType(response, &metadata) } output := &DeprecateWorkflowTypeOutput{} 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 awsAwsjson10_deserializeOpErrorDeprecateWorkflowType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeDeprecatedFault", errorCode): return awsAwsjson10_deserializeErrorTypeDeprecatedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDescribeActivityType struct { } func (*awsAwsjson10_deserializeOpDescribeActivityType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDescribeActivityType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDescribeActivityType(response, &metadata) } output := &DescribeActivityTypeOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDescribeActivityTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDescribeActivityType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDescribeDomain struct { } func (*awsAwsjson10_deserializeOpDescribeDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDescribeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDescribeDomain(response, &metadata) } output := &DescribeDomainOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDescribeDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDescribeDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDescribeWorkflowExecution struct { } func (*awsAwsjson10_deserializeOpDescribeWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDescribeWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDescribeWorkflowExecution(response, &metadata) } output := &DescribeWorkflowExecutionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDescribeWorkflowExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDescribeWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDescribeWorkflowType struct { } func (*awsAwsjson10_deserializeOpDescribeWorkflowType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDescribeWorkflowType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDescribeWorkflowType(response, &metadata) } output := &DescribeWorkflowTypeOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDescribeWorkflowTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDescribeWorkflowType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetWorkflowExecutionHistory struct { } func (*awsAwsjson10_deserializeOpGetWorkflowExecutionHistory) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetWorkflowExecutionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetWorkflowExecutionHistory(response, &metadata) } output := &GetWorkflowExecutionHistoryOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetWorkflowExecutionHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetWorkflowExecutionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListActivityTypes struct { } func (*awsAwsjson10_deserializeOpListActivityTypes) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListActivityTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListActivityTypes(response, &metadata) } output := &ListActivityTypesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListActivityTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListActivityTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListClosedWorkflowExecutions struct { } func (*awsAwsjson10_deserializeOpListClosedWorkflowExecutions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListClosedWorkflowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListClosedWorkflowExecutions(response, &metadata) } output := &ListClosedWorkflowExecutionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListClosedWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListClosedWorkflowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListDomains struct { } func (*awsAwsjson10_deserializeOpListDomains) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListDomains(response, &metadata) } output := &ListDomainsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListDomainsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListOpenWorkflowExecutions struct { } func (*awsAwsjson10_deserializeOpListOpenWorkflowExecutions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListOpenWorkflowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListOpenWorkflowExecutions(response, &metadata) } output := &ListOpenWorkflowExecutionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListOpenWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListOpenWorkflowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListTagsForResource struct { } func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_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 = awsAwsjson10_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 awsAwsjson10_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("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListWorkflowTypes struct { } func (*awsAwsjson10_deserializeOpListWorkflowTypes) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListWorkflowTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListWorkflowTypes(response, &metadata) } output := &ListWorkflowTypesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListWorkflowTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListWorkflowTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpPollForActivityTask struct { } func (*awsAwsjson10_deserializeOpPollForActivityTask) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpPollForActivityTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorPollForActivityTask(response, &metadata) } output := &PollForActivityTaskOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentPollForActivityTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorPollForActivityTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpPollForDecisionTask struct { } func (*awsAwsjson10_deserializeOpPollForDecisionTask) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpPollForDecisionTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorPollForDecisionTask(response, &metadata) } output := &PollForDecisionTaskOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentPollForDecisionTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorPollForDecisionTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRecordActivityTaskHeartbeat struct { } func (*awsAwsjson10_deserializeOpRecordActivityTaskHeartbeat) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRecordActivityTaskHeartbeat) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRecordActivityTaskHeartbeat(response, &metadata) } output := &RecordActivityTaskHeartbeatOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentRecordActivityTaskHeartbeatOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorRecordActivityTaskHeartbeat(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRegisterActivityType struct { } func (*awsAwsjson10_deserializeOpRegisterActivityType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRegisterActivityType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRegisterActivityType(response, &metadata) } output := &RegisterActivityTypeOutput{} 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 awsAwsjson10_deserializeOpErrorRegisterActivityType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorTypeAlreadyExistsFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRegisterDomain struct { } func (*awsAwsjson10_deserializeOpRegisterDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRegisterDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRegisterDomain(response, &metadata) } output := &RegisterDomainOutput{} 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 awsAwsjson10_deserializeOpErrorRegisterDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("DomainAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorDomainAlreadyExistsFault(response, errorBody) case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TooManyTagsFault", errorCode): return awsAwsjson10_deserializeErrorTooManyTagsFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRegisterWorkflowType struct { } func (*awsAwsjson10_deserializeOpRegisterWorkflowType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRegisterWorkflowType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRegisterWorkflowType(response, &metadata) } output := &RegisterWorkflowTypeOutput{} 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 awsAwsjson10_deserializeOpErrorRegisterWorkflowType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorTypeAlreadyExistsFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRequestCancelWorkflowExecution struct { } func (*awsAwsjson10_deserializeOpRequestCancelWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRequestCancelWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRequestCancelWorkflowExecution(response, &metadata) } output := &RequestCancelWorkflowExecutionOutput{} 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 awsAwsjson10_deserializeOpErrorRequestCancelWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRespondActivityTaskCanceled struct { } func (*awsAwsjson10_deserializeOpRespondActivityTaskCanceled) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRespondActivityTaskCanceled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRespondActivityTaskCanceled(response, &metadata) } output := &RespondActivityTaskCanceledOutput{} 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 awsAwsjson10_deserializeOpErrorRespondActivityTaskCanceled(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRespondActivityTaskCompleted struct { } func (*awsAwsjson10_deserializeOpRespondActivityTaskCompleted) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRespondActivityTaskCompleted) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRespondActivityTaskCompleted(response, &metadata) } output := &RespondActivityTaskCompletedOutput{} 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 awsAwsjson10_deserializeOpErrorRespondActivityTaskCompleted(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRespondActivityTaskFailed struct { } func (*awsAwsjson10_deserializeOpRespondActivityTaskFailed) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRespondActivityTaskFailed) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRespondActivityTaskFailed(response, &metadata) } output := &RespondActivityTaskFailedOutput{} 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 awsAwsjson10_deserializeOpErrorRespondActivityTaskFailed(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpRespondDecisionTaskCompleted struct { } func (*awsAwsjson10_deserializeOpRespondDecisionTaskCompleted) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpRespondDecisionTaskCompleted) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorRespondDecisionTaskCompleted(response, &metadata) } output := &RespondDecisionTaskCompletedOutput{} 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 awsAwsjson10_deserializeOpErrorRespondDecisionTaskCompleted(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpSignalWorkflowExecution struct { } func (*awsAwsjson10_deserializeOpSignalWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpSignalWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorSignalWorkflowExecution(response, &metadata) } output := &SignalWorkflowExecutionOutput{} 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 awsAwsjson10_deserializeOpErrorSignalWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpStartWorkflowExecution struct { } func (*awsAwsjson10_deserializeOpStartWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpStartWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorStartWorkflowExecution(response, &metadata) } output := &StartWorkflowExecutionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentStartWorkflowExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorStartWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("DefaultUndefinedFault", errorCode): return awsAwsjson10_deserializeErrorDefaultUndefinedFault(response, errorBody) case strings.EqualFold("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeDeprecatedFault", errorCode): return awsAwsjson10_deserializeErrorTypeDeprecatedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) case strings.EqualFold("WorkflowExecutionAlreadyStartedFault", errorCode): return awsAwsjson10_deserializeErrorWorkflowExecutionAlreadyStartedFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpTagResource struct { } func (*awsAwsjson10_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_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 awsAwsjson10_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("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TooManyTagsFault", errorCode): return awsAwsjson10_deserializeErrorTooManyTagsFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpTerminateWorkflowExecution struct { } func (*awsAwsjson10_deserializeOpTerminateWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpTerminateWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorTerminateWorkflowExecution(response, &metadata) } output := &TerminateWorkflowExecutionOutput{} 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 awsAwsjson10_deserializeOpErrorTerminateWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUndeprecateActivityType struct { } func (*awsAwsjson10_deserializeOpUndeprecateActivityType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUndeprecateActivityType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUndeprecateActivityType(response, &metadata) } output := &UndeprecateActivityTypeOutput{} 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 awsAwsjson10_deserializeOpErrorUndeprecateActivityType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorTypeAlreadyExistsFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUndeprecateDomain struct { } func (*awsAwsjson10_deserializeOpUndeprecateDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUndeprecateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUndeprecateDomain(response, &metadata) } output := &UndeprecateDomainOutput{} 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 awsAwsjson10_deserializeOpErrorUndeprecateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("DomainAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorDomainAlreadyExistsFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUndeprecateWorkflowType struct { } func (*awsAwsjson10_deserializeOpUndeprecateWorkflowType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUndeprecateWorkflowType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUndeprecateWorkflowType(response, &metadata) } output := &UndeprecateWorkflowTypeOutput{} 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 awsAwsjson10_deserializeOpErrorUndeprecateWorkflowType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("TypeAlreadyExistsFault", errorCode): return awsAwsjson10_deserializeErrorTypeAlreadyExistsFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUntagResource struct { } func (*awsAwsjson10_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_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 awsAwsjson10_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("LimitExceededFault", errorCode): return awsAwsjson10_deserializeErrorLimitExceededFault(response, errorBody) case strings.EqualFold("OperationNotPermittedFault", errorCode): return awsAwsjson10_deserializeErrorOperationNotPermittedFault(response, errorBody) case strings.EqualFold("UnknownResourceFault", errorCode): return awsAwsjson10_deserializeErrorUnknownResourceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson10_deserializeErrorDefaultUndefinedFault(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.DefaultUndefinedFault{} err := awsAwsjson10_deserializeDocumentDefaultUndefinedFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorDomainAlreadyExistsFault(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.DomainAlreadyExistsFault{} err := awsAwsjson10_deserializeDocumentDomainAlreadyExistsFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorDomainDeprecatedFault(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.DomainDeprecatedFault{} err := awsAwsjson10_deserializeDocumentDomainDeprecatedFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorLimitExceededFault(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.LimitExceededFault{} err := awsAwsjson10_deserializeDocumentLimitExceededFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorOperationNotPermittedFault(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.OperationNotPermittedFault{} err := awsAwsjson10_deserializeDocumentOperationNotPermittedFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorTooManyTagsFault(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.TooManyTagsFault{} err := awsAwsjson10_deserializeDocumentTooManyTagsFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorTypeAlreadyExistsFault(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.TypeAlreadyExistsFault{} err := awsAwsjson10_deserializeDocumentTypeAlreadyExistsFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorTypeDeprecatedFault(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.TypeDeprecatedFault{} err := awsAwsjson10_deserializeDocumentTypeDeprecatedFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorUnknownResourceFault(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.UnknownResourceFault{} err := awsAwsjson10_deserializeDocumentUnknownResourceFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorWorkflowExecutionAlreadyStartedFault(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.WorkflowExecutionAlreadyStartedFault{} err := awsAwsjson10_deserializeDocumentWorkflowExecutionAlreadyStartedFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeDocumentActivityTaskCanceledEventAttributes(v **types.ActivityTaskCanceledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskCanceledEventAttributes if *v == nil { sv = &types.ActivityTaskCanceledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "latestCancelRequestedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LatestCancelRequestedEventId = i64 } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskCancelRequestedEventAttributes(v **types.ActivityTaskCancelRequestedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskCancelRequestedEventAttributes if *v == nil { sv = &types.ActivityTaskCancelRequestedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "activityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityId to be of type string, got %T instead", value) } sv.ActivityId = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskCompletedEventAttributes(v **types.ActivityTaskCompletedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskCompletedEventAttributes if *v == nil { sv = &types.ActivityTaskCompletedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "result": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Result = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskFailedEventAttributes(v **types.ActivityTaskFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskFailedEventAttributes if *v == nil { sv = &types.ActivityTaskFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskScheduledEventAttributes(v **types.ActivityTaskScheduledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskScheduledEventAttributes if *v == nil { sv = &types.ActivityTaskScheduledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "activityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityId to be of type string, got %T instead", value) } sv.ActivityId = ptr.String(jtv) } case "activityType": if err := awsAwsjson10_deserializeDocumentActivityType(&sv.ActivityType, value); err != nil { return err } case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "heartbeatTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.HeartbeatTimeout = ptr.String(jtv) } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "scheduleToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.ScheduleToCloseTimeout = ptr.String(jtv) } case "scheduleToStartTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.ScheduleToStartTimeout = ptr.String(jtv) } case "startToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.StartToCloseTimeout = ptr.String(jtv) } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskStartedEventAttributes(v **types.ActivityTaskStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskStartedEventAttributes if *v == nil { sv = &types.ActivityTaskStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "identity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identity to be of type string, got %T instead", value) } sv.Identity = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTaskTimedOutEventAttributes(v **types.ActivityTaskTimedOutEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTaskTimedOutEventAttributes if *v == nil { sv = &types.ActivityTaskTimedOutEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedData to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timeoutType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityTaskTimeoutType to be of type string, got %T instead", value) } sv.TimeoutType = types.ActivityTaskTimeoutType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityType(v **types.ActivityType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityType if *v == nil { sv = &types.ActivityType{} } 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 Name to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Version to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTypeConfiguration(v **types.ActivityTypeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTypeConfiguration if *v == nil { sv = &types.ActivityTypeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "defaultTaskHeartbeatTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultTaskHeartbeatTimeout = ptr.String(jtv) } case "defaultTaskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.DefaultTaskList, value); err != nil { return err } case "defaultTaskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.DefaultTaskPriority = ptr.String(jtv) } case "defaultTaskScheduleToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultTaskScheduleToCloseTimeout = ptr.String(jtv) } case "defaultTaskScheduleToStartTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultTaskScheduleToStartTimeout = ptr.String(jtv) } case "defaultTaskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultTaskStartToCloseTimeout = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTypeInfo(v **types.ActivityTypeInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActivityTypeInfo if *v == nil { sv = &types.ActivityTypeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "activityType": if err := awsAwsjson10_deserializeDocumentActivityType(&sv.ActivityType, value); err != nil { return err } case "creationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "deprecationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeprecationDate = 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 "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistrationStatus to be of type string, got %T instead", value) } sv.Status = types.RegistrationStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentActivityTypeInfoList(v *[]types.ActivityTypeInfo, 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.ActivityTypeInfo if *v == nil { cv = []types.ActivityTypeInfo{} } else { cv = *v } for _, value := range shape { var col types.ActivityTypeInfo destAddr := &col if err := awsAwsjson10_deserializeDocumentActivityTypeInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentCancelTimerFailedEventAttributes(v **types.CancelTimerFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CancelTimerFailedEventAttributes if *v == nil { sv = &types.CancelTimerFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CancelTimerFailedCause to be of type string, got %T instead", value) } sv.Cause = types.CancelTimerFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "timerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimerId to be of type string, got %T instead", value) } sv.TimerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCancelWorkflowExecutionFailedEventAttributes(v **types.CancelWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CancelWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.CancelWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CancelWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.CancelWorkflowExecutionFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionCanceledEventAttributes(v **types.ChildWorkflowExecutionCanceledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionCanceledEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionCanceledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionCompletedEventAttributes(v **types.ChildWorkflowExecutionCompletedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionCompletedEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionCompletedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "result": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Result = ptr.String(jtv) } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionFailedEventAttributes(v **types.ChildWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionStartedEventAttributes(v **types.ChildWorkflowExecutionStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionStartedEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionTerminatedEventAttributes(v **types.ChildWorkflowExecutionTerminatedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionTerminatedEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionTerminatedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentChildWorkflowExecutionTimedOutEventAttributes(v **types.ChildWorkflowExecutionTimedOutEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChildWorkflowExecutionTimedOutEventAttributes if *v == nil { sv = &types.ChildWorkflowExecutionTimedOutEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timeoutType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionTimeoutType to be of type string, got %T instead", value) } sv.TimeoutType = types.WorkflowExecutionTimeoutType(jtv) } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCompleteWorkflowExecutionFailedEventAttributes(v **types.CompleteWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CompleteWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.CompleteWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CompleteWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.CompleteWorkflowExecutionFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentContinueAsNewWorkflowExecutionFailedEventAttributes(v **types.ContinueAsNewWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ContinueAsNewWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.ContinueAsNewWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContinueAsNewWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.ContinueAsNewWorkflowExecutionFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDecisionTaskCompletedEventAttributes(v **types.DecisionTaskCompletedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DecisionTaskCompletedEventAttributes if *v == nil { sv = &types.DecisionTaskCompletedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "executionContext": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.ExecutionContext = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDecisionTaskScheduledEventAttributes(v **types.DecisionTaskScheduledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DecisionTaskScheduledEventAttributes if *v == nil { sv = &types.DecisionTaskScheduledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "startToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.StartToCloseTimeout = ptr.String(jtv) } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDecisionTaskStartedEventAttributes(v **types.DecisionTaskStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DecisionTaskStartedEventAttributes if *v == nil { sv = &types.DecisionTaskStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "identity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identity to be of type string, got %T instead", value) } sv.Identity = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDecisionTaskTimedOutEventAttributes(v **types.DecisionTaskTimedOutEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DecisionTaskTimedOutEventAttributes if *v == nil { sv = &types.DecisionTaskTimedOutEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timeoutType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DecisionTaskTimeoutType to be of type string, got %T instead", value) } sv.TimeoutType = types.DecisionTaskTimeoutType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDefaultUndefinedFault(v **types.DefaultUndefinedFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DefaultUndefinedFault if *v == nil { sv = &types.DefaultUndefinedFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDomainAlreadyExistsFault(v **types.DomainAlreadyExistsFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DomainAlreadyExistsFault if *v == nil { sv = &types.DomainAlreadyExistsFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDomainConfiguration(v **types.DomainConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DomainConfiguration if *v == nil { sv = &types.DomainConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "workflowExecutionRetentionPeriodInDays": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInDays to be of type string, got %T instead", value) } sv.WorkflowExecutionRetentionPeriodInDays = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDomainDeprecatedFault(v **types.DomainDeprecatedFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DomainDeprecatedFault if *v == nil { sv = &types.DomainDeprecatedFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDomainInfo(v **types.DomainInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DomainInfo if *v == nil { sv = &types.DomainInfo{} } 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 Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName 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 RegistrationStatus to be of type string, got %T instead", value) } sv.Status = types.RegistrationStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDomainInfoList(v *[]types.DomainInfo, 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.DomainInfo if *v == nil { cv = []types.DomainInfo{} } else { cv = *v } for _, value := range shape { var col types.DomainInfo destAddr := &col if err := awsAwsjson10_deserializeDocumentDomainInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentExternalWorkflowExecutionCancelRequestedEventAttributes(v **types.ExternalWorkflowExecutionCancelRequestedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExternalWorkflowExecutionCancelRequestedEventAttributes if *v == nil { sv = &types.ExternalWorkflowExecutionCancelRequestedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentExternalWorkflowExecutionSignaledEventAttributes(v **types.ExternalWorkflowExecutionSignaledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExternalWorkflowExecutionSignaledEventAttributes if *v == nil { sv = &types.ExternalWorkflowExecutionSignaledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentFailWorkflowExecutionFailedEventAttributes(v **types.FailWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.FailWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.FailWorkflowExecutionFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentHistoryEvent(v **types.HistoryEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HistoryEvent if *v == nil { sv = &types.HistoryEvent{} } else { sv = *v } for key, value := range shape { switch key { case "activityTaskCanceledEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskCanceledEventAttributes(&sv.ActivityTaskCanceledEventAttributes, value); err != nil { return err } case "activityTaskCancelRequestedEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskCancelRequestedEventAttributes(&sv.ActivityTaskCancelRequestedEventAttributes, value); err != nil { return err } case "activityTaskCompletedEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskCompletedEventAttributes(&sv.ActivityTaskCompletedEventAttributes, value); err != nil { return err } case "activityTaskFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskFailedEventAttributes(&sv.ActivityTaskFailedEventAttributes, value); err != nil { return err } case "activityTaskScheduledEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskScheduledEventAttributes(&sv.ActivityTaskScheduledEventAttributes, value); err != nil { return err } case "activityTaskStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskStartedEventAttributes(&sv.ActivityTaskStartedEventAttributes, value); err != nil { return err } case "activityTaskTimedOutEventAttributes": if err := awsAwsjson10_deserializeDocumentActivityTaskTimedOutEventAttributes(&sv.ActivityTaskTimedOutEventAttributes, value); err != nil { return err } case "cancelTimerFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentCancelTimerFailedEventAttributes(&sv.CancelTimerFailedEventAttributes, value); err != nil { return err } case "cancelWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentCancelWorkflowExecutionFailedEventAttributes(&sv.CancelWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "childWorkflowExecutionCanceledEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionCanceledEventAttributes(&sv.ChildWorkflowExecutionCanceledEventAttributes, value); err != nil { return err } case "childWorkflowExecutionCompletedEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionCompletedEventAttributes(&sv.ChildWorkflowExecutionCompletedEventAttributes, value); err != nil { return err } case "childWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionFailedEventAttributes(&sv.ChildWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "childWorkflowExecutionStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionStartedEventAttributes(&sv.ChildWorkflowExecutionStartedEventAttributes, value); err != nil { return err } case "childWorkflowExecutionTerminatedEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionTerminatedEventAttributes(&sv.ChildWorkflowExecutionTerminatedEventAttributes, value); err != nil { return err } case "childWorkflowExecutionTimedOutEventAttributes": if err := awsAwsjson10_deserializeDocumentChildWorkflowExecutionTimedOutEventAttributes(&sv.ChildWorkflowExecutionTimedOutEventAttributes, value); err != nil { return err } case "completeWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentCompleteWorkflowExecutionFailedEventAttributes(&sv.CompleteWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "continueAsNewWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentContinueAsNewWorkflowExecutionFailedEventAttributes(&sv.ContinueAsNewWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "decisionTaskCompletedEventAttributes": if err := awsAwsjson10_deserializeDocumentDecisionTaskCompletedEventAttributes(&sv.DecisionTaskCompletedEventAttributes, value); err != nil { return err } case "decisionTaskScheduledEventAttributes": if err := awsAwsjson10_deserializeDocumentDecisionTaskScheduledEventAttributes(&sv.DecisionTaskScheduledEventAttributes, value); err != nil { return err } case "decisionTaskStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentDecisionTaskStartedEventAttributes(&sv.DecisionTaskStartedEventAttributes, value); err != nil { return err } case "decisionTaskTimedOutEventAttributes": if err := awsAwsjson10_deserializeDocumentDecisionTaskTimedOutEventAttributes(&sv.DecisionTaskTimedOutEventAttributes, value); err != nil { return err } case "eventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EventId = i64 } case "eventTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EventTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "eventType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EventType to be of type string, got %T instead", value) } sv.EventType = types.EventType(jtv) } case "externalWorkflowExecutionCancelRequestedEventAttributes": if err := awsAwsjson10_deserializeDocumentExternalWorkflowExecutionCancelRequestedEventAttributes(&sv.ExternalWorkflowExecutionCancelRequestedEventAttributes, value); err != nil { return err } case "externalWorkflowExecutionSignaledEventAttributes": if err := awsAwsjson10_deserializeDocumentExternalWorkflowExecutionSignaledEventAttributes(&sv.ExternalWorkflowExecutionSignaledEventAttributes, value); err != nil { return err } case "failWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentFailWorkflowExecutionFailedEventAttributes(&sv.FailWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "lambdaFunctionCompletedEventAttributes": if err := awsAwsjson10_deserializeDocumentLambdaFunctionCompletedEventAttributes(&sv.LambdaFunctionCompletedEventAttributes, value); err != nil { return err } case "lambdaFunctionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentLambdaFunctionFailedEventAttributes(&sv.LambdaFunctionFailedEventAttributes, value); err != nil { return err } case "lambdaFunctionScheduledEventAttributes": if err := awsAwsjson10_deserializeDocumentLambdaFunctionScheduledEventAttributes(&sv.LambdaFunctionScheduledEventAttributes, value); err != nil { return err } case "lambdaFunctionStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentLambdaFunctionStartedEventAttributes(&sv.LambdaFunctionStartedEventAttributes, value); err != nil { return err } case "lambdaFunctionTimedOutEventAttributes": if err := awsAwsjson10_deserializeDocumentLambdaFunctionTimedOutEventAttributes(&sv.LambdaFunctionTimedOutEventAttributes, value); err != nil { return err } case "markerRecordedEventAttributes": if err := awsAwsjson10_deserializeDocumentMarkerRecordedEventAttributes(&sv.MarkerRecordedEventAttributes, value); err != nil { return err } case "recordMarkerFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentRecordMarkerFailedEventAttributes(&sv.RecordMarkerFailedEventAttributes, value); err != nil { return err } case "requestCancelActivityTaskFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentRequestCancelActivityTaskFailedEventAttributes(&sv.RequestCancelActivityTaskFailedEventAttributes, value); err != nil { return err } case "requestCancelExternalWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentRequestCancelExternalWorkflowExecutionFailedEventAttributes(&sv.RequestCancelExternalWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "requestCancelExternalWorkflowExecutionInitiatedEventAttributes": if err := awsAwsjson10_deserializeDocumentRequestCancelExternalWorkflowExecutionInitiatedEventAttributes(&sv.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes, value); err != nil { return err } case "scheduleActivityTaskFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentScheduleActivityTaskFailedEventAttributes(&sv.ScheduleActivityTaskFailedEventAttributes, value); err != nil { return err } case "scheduleLambdaFunctionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentScheduleLambdaFunctionFailedEventAttributes(&sv.ScheduleLambdaFunctionFailedEventAttributes, value); err != nil { return err } case "signalExternalWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentSignalExternalWorkflowExecutionFailedEventAttributes(&sv.SignalExternalWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "signalExternalWorkflowExecutionInitiatedEventAttributes": if err := awsAwsjson10_deserializeDocumentSignalExternalWorkflowExecutionInitiatedEventAttributes(&sv.SignalExternalWorkflowExecutionInitiatedEventAttributes, value); err != nil { return err } case "startChildWorkflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentStartChildWorkflowExecutionFailedEventAttributes(&sv.StartChildWorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "startChildWorkflowExecutionInitiatedEventAttributes": if err := awsAwsjson10_deserializeDocumentStartChildWorkflowExecutionInitiatedEventAttributes(&sv.StartChildWorkflowExecutionInitiatedEventAttributes, value); err != nil { return err } case "startLambdaFunctionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentStartLambdaFunctionFailedEventAttributes(&sv.StartLambdaFunctionFailedEventAttributes, value); err != nil { return err } case "startTimerFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentStartTimerFailedEventAttributes(&sv.StartTimerFailedEventAttributes, value); err != nil { return err } case "timerCanceledEventAttributes": if err := awsAwsjson10_deserializeDocumentTimerCanceledEventAttributes(&sv.TimerCanceledEventAttributes, value); err != nil { return err } case "timerFiredEventAttributes": if err := awsAwsjson10_deserializeDocumentTimerFiredEventAttributes(&sv.TimerFiredEventAttributes, value); err != nil { return err } case "timerStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentTimerStartedEventAttributes(&sv.TimerStartedEventAttributes, value); err != nil { return err } case "workflowExecutionCanceledEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionCanceledEventAttributes(&sv.WorkflowExecutionCanceledEventAttributes, value); err != nil { return err } case "workflowExecutionCancelRequestedEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionCancelRequestedEventAttributes(&sv.WorkflowExecutionCancelRequestedEventAttributes, value); err != nil { return err } case "workflowExecutionCompletedEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionCompletedEventAttributes(&sv.WorkflowExecutionCompletedEventAttributes, value); err != nil { return err } case "workflowExecutionContinuedAsNewEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionContinuedAsNewEventAttributes(&sv.WorkflowExecutionContinuedAsNewEventAttributes, value); err != nil { return err } case "workflowExecutionFailedEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionFailedEventAttributes(&sv.WorkflowExecutionFailedEventAttributes, value); err != nil { return err } case "workflowExecutionSignaledEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionSignaledEventAttributes(&sv.WorkflowExecutionSignaledEventAttributes, value); err != nil { return err } case "workflowExecutionStartedEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionStartedEventAttributes(&sv.WorkflowExecutionStartedEventAttributes, value); err != nil { return err } case "workflowExecutionTerminatedEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionTerminatedEventAttributes(&sv.WorkflowExecutionTerminatedEventAttributes, value); err != nil { return err } case "workflowExecutionTimedOutEventAttributes": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionTimedOutEventAttributes(&sv.WorkflowExecutionTimedOutEventAttributes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentHistoryEventList(v *[]types.HistoryEvent, 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.HistoryEvent if *v == nil { cv = []types.HistoryEvent{} } else { cv = *v } for _, value := range shape { var col types.HistoryEvent destAddr := &col if err := awsAwsjson10_deserializeDocumentHistoryEvent(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentLambdaFunctionCompletedEventAttributes(v **types.LambdaFunctionCompletedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionCompletedEventAttributes if *v == nil { sv = &types.LambdaFunctionCompletedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "result": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Result = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentLambdaFunctionFailedEventAttributes(v **types.LambdaFunctionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionFailedEventAttributes if *v == nil { sv = &types.LambdaFunctionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentLambdaFunctionScheduledEventAttributes(v **types.LambdaFunctionScheduledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionScheduledEventAttributes if *v == nil { sv = &types.LambdaFunctionScheduledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionInput to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "startToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.StartToCloseTimeout = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentLambdaFunctionStartedEventAttributes(v **types.LambdaFunctionStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionStartedEventAttributes if *v == nil { sv = &types.LambdaFunctionStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentLambdaFunctionTimedOutEventAttributes(v **types.LambdaFunctionTimedOutEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionTimedOutEventAttributes if *v == nil { sv = &types.LambdaFunctionTimedOutEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timeoutType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LambdaFunctionTimeoutType to be of type string, got %T instead", value) } sv.TimeoutType = types.LambdaFunctionTimeoutType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentLimitExceededFault(v **types.LimitExceededFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededFault if *v == nil { sv = &types.LimitExceededFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentMarkerRecordedEventAttributes(v **types.MarkerRecordedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MarkerRecordedEventAttributes if *v == nil { sv = &types.MarkerRecordedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "markerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MarkerName to be of type string, got %T instead", value) } sv.MarkerName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentOperationNotPermittedFault(v **types.OperationNotPermittedFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.OperationNotPermittedFault if *v == nil { sv = &types.OperationNotPermittedFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentRecordMarkerFailedEventAttributes(v **types.RecordMarkerFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RecordMarkerFailedEventAttributes if *v == nil { sv = &types.RecordMarkerFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RecordMarkerFailedCause to be of type string, got %T instead", value) } sv.Cause = types.RecordMarkerFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "markerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MarkerName to be of type string, got %T instead", value) } sv.MarkerName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentRequestCancelActivityTaskFailedEventAttributes(v **types.RequestCancelActivityTaskFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RequestCancelActivityTaskFailedEventAttributes if *v == nil { sv = &types.RequestCancelActivityTaskFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "activityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityId to be of type string, got %T instead", value) } sv.ActivityId = ptr.String(jtv) } case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestCancelActivityTaskFailedCause to be of type string, got %T instead", value) } sv.Cause = types.RequestCancelActivityTaskFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentRequestCancelExternalWorkflowExecutionFailedEventAttributes(v **types.RequestCancelExternalWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RequestCancelExternalWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.RequestCancelExternalWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestCancelExternalWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.RequestCancelExternalWorkflowExecutionFailedCause(jtv) } case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunIdOptional to be of type string, got %T instead", value) } sv.RunId = 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 awsAwsjson10_deserializeDocumentRequestCancelExternalWorkflowExecutionInitiatedEventAttributes(v **types.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes if *v == nil { sv = &types.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunIdOptional to be of type string, got %T instead", value) } sv.RunId = 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 awsAwsjson10_deserializeDocumentResourceTag(v **types.ResourceTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceTag if *v == nil { sv = &types.ResourceTag{} } 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 ResourceTagKey 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 ResourceTagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentResourceTagList(v *[]types.ResourceTag, 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.ResourceTag if *v == nil { cv = []types.ResourceTag{} } else { cv = *v } for _, value := range shape { var col types.ResourceTag destAddr := &col if err := awsAwsjson10_deserializeDocumentResourceTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentScheduleActivityTaskFailedEventAttributes(v **types.ScheduleActivityTaskFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ScheduleActivityTaskFailedEventAttributes if *v == nil { sv = &types.ScheduleActivityTaskFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "activityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityId to be of type string, got %T instead", value) } sv.ActivityId = ptr.String(jtv) } case "activityType": if err := awsAwsjson10_deserializeDocumentActivityType(&sv.ActivityType, value); err != nil { return err } case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduleActivityTaskFailedCause to be of type string, got %T instead", value) } sv.Cause = types.ScheduleActivityTaskFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentScheduleLambdaFunctionFailedEventAttributes(v **types.ScheduleLambdaFunctionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ScheduleLambdaFunctionFailedEventAttributes if *v == nil { sv = &types.ScheduleLambdaFunctionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduleLambdaFunctionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.ScheduleLambdaFunctionFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSignalExternalWorkflowExecutionFailedEventAttributes(v **types.SignalExternalWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SignalExternalWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.SignalExternalWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SignalExternalWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.SignalExternalWorkflowExecutionFailedCause(jtv) } case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunIdOptional to be of type string, got %T instead", value) } sv.RunId = 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 awsAwsjson10_deserializeDocumentSignalExternalWorkflowExecutionInitiatedEventAttributes(v **types.SignalExternalWorkflowExecutionInitiatedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SignalExternalWorkflowExecutionInitiatedEventAttributes if *v == nil { sv = &types.SignalExternalWorkflowExecutionInitiatedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunIdOptional to be of type string, got %T instead", value) } sv.RunId = ptr.String(jtv) } case "signalName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SignalName to be of type string, got %T instead", value) } sv.SignalName = 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 awsAwsjson10_deserializeDocumentStartChildWorkflowExecutionFailedEventAttributes(v **types.StartChildWorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StartChildWorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.StartChildWorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StartChildWorkflowExecutionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.StartChildWorkflowExecutionFailedCause(jtv) } case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "initiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InitiatedEventId = i64 } 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) } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentStartChildWorkflowExecutionInitiatedEventAttributes(v **types.StartChildWorkflowExecutionInitiatedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StartChildWorkflowExecutionInitiatedEventAttributes if *v == nil { sv = &types.StartChildWorkflowExecutionInitiatedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "executionStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.ExecutionStartToCloseTimeout = ptr.String(jtv) } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "lambdaRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LambdaRole = ptr.String(jtv) } case "tagList": if err := awsAwsjson10_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } case "taskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.TaskStartToCloseTimeout = 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) } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentStartLambdaFunctionFailedEventAttributes(v **types.StartLambdaFunctionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StartLambdaFunctionFailedEventAttributes if *v == nil { sv = &types.StartLambdaFunctionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StartLambdaFunctionFailedCause to be of type string, got %T instead", value) } sv.Cause = types.StartLambdaFunctionFailedCause(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CauseMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "scheduledEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledEventId = i64 } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentStartTimerFailedEventAttributes(v **types.StartTimerFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StartTimerFailedEventAttributes if *v == nil { sv = &types.StartTimerFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StartTimerFailedCause to be of type string, got %T instead", value) } sv.Cause = types.StartTimerFailedCause(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "timerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimerId to be of type string, got %T instead", value) } sv.TimerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTagList(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 Tag to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentTaskList(v **types.TaskList, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TaskList if *v == nil { sv = &types.TaskList{} } 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 Name to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTimerCanceledEventAttributes(v **types.TimerCanceledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TimerCanceledEventAttributes if *v == nil { sv = &types.TimerCanceledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimerId to be of type string, got %T instead", value) } sv.TimerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTimerFiredEventAttributes(v **types.TimerFiredEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TimerFiredEventAttributes if *v == nil { sv = &types.TimerFiredEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "timerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimerId to be of type string, got %T instead", value) } sv.TimerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTimerStartedEventAttributes(v **types.TimerStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TimerStartedEventAttributes if *v == nil { sv = &types.TimerStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "control": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Control = ptr.String(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "startToFireTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSeconds to be of type string, got %T instead", value) } sv.StartToFireTimeout = ptr.String(jtv) } case "timerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimerId to be of type string, got %T instead", value) } sv.TimerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTooManyTagsFault(v **types.TooManyTagsFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyTagsFault if *v == nil { sv = &types.TooManyTagsFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTypeAlreadyExistsFault(v **types.TypeAlreadyExistsFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TypeAlreadyExistsFault if *v == nil { sv = &types.TypeAlreadyExistsFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTypeDeprecatedFault(v **types.TypeDeprecatedFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TypeDeprecatedFault if *v == nil { sv = &types.TypeDeprecatedFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentUnknownResourceFault(v **types.UnknownResourceFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnknownResourceFault if *v == nil { sv = &types.UnknownResourceFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecution(v **types.WorkflowExecution, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecution if *v == nil { sv = &types.WorkflowExecution{} } else { sv = *v } for key, value := range shape { switch key { case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunId to be of type string, got %T instead", value) } sv.RunId = 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 awsAwsjson10_deserializeDocumentWorkflowExecutionAlreadyStartedFault(v **types.WorkflowExecutionAlreadyStartedFault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionAlreadyStartedFault if *v == nil { sv = &types.WorkflowExecutionAlreadyStartedFault{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionCanceledEventAttributes(v **types.WorkflowExecutionCanceledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionCanceledEventAttributes if *v == nil { sv = &types.WorkflowExecutionCanceledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionCancelRequestedEventAttributes(v **types.WorkflowExecutionCancelRequestedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionCancelRequestedEventAttributes if *v == nil { sv = &types.WorkflowExecutionCancelRequestedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionCancelRequestedCause to be of type string, got %T instead", value) } sv.Cause = types.WorkflowExecutionCancelRequestedCause(jtv) } case "externalInitiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ExternalInitiatedEventId = i64 } case "externalWorkflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.ExternalWorkflowExecution, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionCompletedEventAttributes(v **types.WorkflowExecutionCompletedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionCompletedEventAttributes if *v == nil { sv = &types.WorkflowExecutionCompletedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "result": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Result = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionConfiguration(v **types.WorkflowExecutionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionConfiguration if *v == nil { sv = &types.WorkflowExecutionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "executionStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSeconds to be of type string, got %T instead", value) } sv.ExecutionStartToCloseTimeout = ptr.String(jtv) } case "lambdaRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LambdaRole = ptr.String(jtv) } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } case "taskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSeconds to be of type string, got %T instead", value) } sv.TaskStartToCloseTimeout = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionContinuedAsNewEventAttributes(v **types.WorkflowExecutionContinuedAsNewEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionContinuedAsNewEventAttributes if *v == nil { sv = &types.WorkflowExecutionContinuedAsNewEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "executionStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.ExecutionStartToCloseTimeout = ptr.String(jtv) } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "lambdaRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LambdaRole = ptr.String(jtv) } case "newExecutionRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunId to be of type string, got %T instead", value) } sv.NewExecutionRunId = ptr.String(jtv) } case "tagList": if err := awsAwsjson10_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } case "taskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.TaskStartToCloseTimeout = ptr.String(jtv) } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionFailedEventAttributes(v **types.WorkflowExecutionFailedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionFailedEventAttributes if *v == nil { sv = &types.WorkflowExecutionFailedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "decisionTaskCompletedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecisionTaskCompletedEventId = i64 } case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionInfo(v **types.WorkflowExecutionInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionInfo if *v == nil { sv = &types.WorkflowExecutionInfo{} } else { sv = *v } for key, value := range shape { switch key { case "cancelRequested": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Canceled to be of type *bool, got %T instead", value) } sv.CancelRequested = jtv } case "closeStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CloseStatus to be of type string, got %T instead", value) } sv.CloseStatus = types.CloseStatus(jtv) } case "closeTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CloseTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "execution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.Execution, value); err != nil { return err } case "executionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionStatus to be of type string, got %T instead", value) } sv.ExecutionStatus = types.ExecutionStatus(jtv) } case "parent": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.Parent, value); err != nil { return err } case "startTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "tagList": if err := awsAwsjson10_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionInfoList(v *[]types.WorkflowExecutionInfo, 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.WorkflowExecutionInfo if *v == nil { cv = []types.WorkflowExecutionInfo{} } else { cv = *v } for _, value := range shape { var col types.WorkflowExecutionInfo destAddr := &col if err := awsAwsjson10_deserializeDocumentWorkflowExecutionInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionOpenCounts(v **types.WorkflowExecutionOpenCounts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionOpenCounts if *v == nil { sv = &types.WorkflowExecutionOpenCounts{} } else { sv = *v } for key, value := range shape { switch key { case "openActivityTasks": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OpenActivityTasks = int32(i64) } case "openChildWorkflowExecutions": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OpenChildWorkflowExecutions = int32(i64) } case "openDecisionTasks": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OpenDecisionTasksCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OpenDecisionTasks = int32(i64) } case "openLambdaFunctions": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OpenLambdaFunctions = int32(i64) } case "openTimers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OpenTimers = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionSignaledEventAttributes(v **types.WorkflowExecutionSignaledEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionSignaledEventAttributes if *v == nil { sv = &types.WorkflowExecutionSignaledEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "externalInitiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ExternalInitiatedEventId = i64 } case "externalWorkflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.ExternalWorkflowExecution, value); err != nil { return err } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "signalName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SignalName to be of type string, got %T instead", value) } sv.SignalName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionStartedEventAttributes(v **types.WorkflowExecutionStartedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionStartedEventAttributes if *v == nil { sv = &types.WorkflowExecutionStartedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "continuedExecutionRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunIdOptional to be of type string, got %T instead", value) } sv.ContinuedExecutionRunId = ptr.String(jtv) } case "executionStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.ExecutionStartToCloseTimeout = ptr.String(jtv) } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "lambdaRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LambdaRole = ptr.String(jtv) } case "parentInitiatedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ParentInitiatedEventId = i64 } case "parentWorkflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.ParentWorkflowExecution, value); err != nil { return err } case "tagList": if err := awsAwsjson10_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } case "taskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.TaskList, value); err != nil { return err } case "taskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.TaskPriority = ptr.String(jtv) } case "taskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.TaskStartToCloseTimeout = ptr.String(jtv) } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionTerminatedEventAttributes(v **types.WorkflowExecutionTerminatedEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionTerminatedEventAttributes if *v == nil { sv = &types.WorkflowExecutionTerminatedEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "cause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionTerminatedCause to be of type string, got %T instead", value) } sv.Cause = types.WorkflowExecutionTerminatedCause(jtv) } case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TerminateReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowExecutionTimedOutEventAttributes(v **types.WorkflowExecutionTimedOutEventAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowExecutionTimedOutEventAttributes if *v == nil { sv = &types.WorkflowExecutionTimedOutEventAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "childPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.ChildPolicy = types.ChildPolicy(jtv) } case "timeoutType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionTimeoutType to be of type string, got %T instead", value) } sv.TimeoutType = types.WorkflowExecutionTimeoutType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowType(v **types.WorkflowType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowType if *v == nil { sv = &types.WorkflowType{} } 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 Name to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Version to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowTypeConfiguration(v **types.WorkflowTypeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowTypeConfiguration if *v == nil { sv = &types.WorkflowTypeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "defaultChildPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildPolicy to be of type string, got %T instead", value) } sv.DefaultChildPolicy = types.ChildPolicy(jtv) } case "defaultExecutionStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultExecutionStartToCloseTimeout = ptr.String(jtv) } case "defaultLambdaRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DefaultLambdaRole = ptr.String(jtv) } case "defaultTaskList": if err := awsAwsjson10_deserializeDocumentTaskList(&sv.DefaultTaskList, value); err != nil { return err } case "defaultTaskPriority": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskPriority to be of type string, got %T instead", value) } sv.DefaultTaskPriority = ptr.String(jtv) } case "defaultTaskStartToCloseTimeout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DurationInSecondsOptional to be of type string, got %T instead", value) } sv.DefaultTaskStartToCloseTimeout = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowTypeInfo(v **types.WorkflowTypeInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowTypeInfo if *v == nil { sv = &types.WorkflowTypeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "creationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "deprecationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeprecationDate = 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 "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistrationStatus to be of type string, got %T instead", value) } sv.Status = types.RegistrationStatus(jtv) } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentWorkflowTypeInfoList(v *[]types.WorkflowTypeInfo, 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.WorkflowTypeInfo if *v == nil { cv = []types.WorkflowTypeInfo{} } else { cv = *v } for _, value := range shape { var col types.WorkflowTypeInfo destAddr := &col if err := awsAwsjson10_deserializeDocumentWorkflowTypeInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeOpDocumentCountClosedWorkflowExecutionsOutput(v **CountClosedWorkflowExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CountClosedWorkflowExecutionsOutput if *v == nil { sv = &CountClosedWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } case "truncated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Truncated to be of type *bool, got %T instead", value) } sv.Truncated = jtv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCountOpenWorkflowExecutionsOutput(v **CountOpenWorkflowExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CountOpenWorkflowExecutionsOutput if *v == nil { sv = &CountOpenWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } case "truncated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Truncated to be of type *bool, got %T instead", value) } sv.Truncated = jtv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCountPendingActivityTasksOutput(v **CountPendingActivityTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CountPendingActivityTasksOutput if *v == nil { sv = &CountPendingActivityTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } case "truncated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Truncated to be of type *bool, got %T instead", value) } sv.Truncated = jtv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCountPendingDecisionTasksOutput(v **CountPendingDecisionTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CountPendingDecisionTasksOutput if *v == nil { sv = &CountPendingDecisionTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } case "truncated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Truncated to be of type *bool, got %T instead", value) } sv.Truncated = jtv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDescribeActivityTypeOutput(v **DescribeActivityTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeActivityTypeOutput if *v == nil { sv = &DescribeActivityTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configuration": if err := awsAwsjson10_deserializeDocumentActivityTypeConfiguration(&sv.Configuration, value); err != nil { return err } case "typeInfo": if err := awsAwsjson10_deserializeDocumentActivityTypeInfo(&sv.TypeInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDomainOutput if *v == nil { sv = &DescribeDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configuration": if err := awsAwsjson10_deserializeDocumentDomainConfiguration(&sv.Configuration, value); err != nil { return err } case "domainInfo": if err := awsAwsjson10_deserializeDocumentDomainInfo(&sv.DomainInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDescribeWorkflowExecutionOutput(v **DescribeWorkflowExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorkflowExecutionOutput if *v == nil { sv = &DescribeWorkflowExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "executionConfiguration": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionConfiguration(&sv.ExecutionConfiguration, value); err != nil { return err } case "executionInfo": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionInfo(&sv.ExecutionInfo, value); err != nil { return err } case "latestActivityTaskTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestActivityTaskTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "latestExecutionContext": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.LatestExecutionContext = ptr.String(jtv) } case "openCounts": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionOpenCounts(&sv.OpenCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDescribeWorkflowTypeOutput(v **DescribeWorkflowTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorkflowTypeOutput if *v == nil { sv = &DescribeWorkflowTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configuration": if err := awsAwsjson10_deserializeDocumentWorkflowTypeConfiguration(&sv.Configuration, value); err != nil { return err } case "typeInfo": if err := awsAwsjson10_deserializeDocumentWorkflowTypeInfo(&sv.TypeInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetWorkflowExecutionHistoryOutput(v **GetWorkflowExecutionHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetWorkflowExecutionHistoryOutput if *v == nil { sv = &GetWorkflowExecutionHistoryOutput{} } else { sv = *v } for key, value := range shape { switch key { case "events": if err := awsAwsjson10_deserializeDocumentHistoryEventList(&sv.Events, value); err != nil { return err } case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListActivityTypesOutput(v **ListActivityTypesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListActivityTypesOutput if *v == nil { sv = &ListActivityTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } case "typeInfos": if err := awsAwsjson10_deserializeDocumentActivityTypeInfoList(&sv.TypeInfos, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListClosedWorkflowExecutionsOutput(v **ListClosedWorkflowExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListClosedWorkflowExecutionsOutput if *v == nil { sv = &ListClosedWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "executionInfos": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionInfoList(&sv.ExecutionInfos, value); err != nil { return err } case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListDomainsOutput(v **ListDomainsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDomainsOutput if *v == nil { sv = &ListDomainsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "domainInfos": if err := awsAwsjson10_deserializeDocumentDomainInfoList(&sv.DomainInfos, value); err != nil { return err } case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListOpenWorkflowExecutionsOutput(v **ListOpenWorkflowExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListOpenWorkflowExecutionsOutput if *v == nil { sv = &ListOpenWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "executionInfos": if err := awsAwsjson10_deserializeDocumentWorkflowExecutionInfoList(&sv.ExecutionInfos, value); err != nil { return err } case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 := awsAwsjson10_deserializeDocumentResourceTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListWorkflowTypesOutput(v **ListWorkflowTypesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorkflowTypesOutput if *v == nil { sv = &ListWorkflowTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } case "typeInfos": if err := awsAwsjson10_deserializeDocumentWorkflowTypeInfoList(&sv.TypeInfos, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentPollForActivityTaskOutput(v **PollForActivityTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PollForActivityTaskOutput if *v == nil { sv = &PollForActivityTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { case "activityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActivityId to be of type string, got %T instead", value) } sv.ActivityId = ptr.String(jtv) } case "activityType": if err := awsAwsjson10_deserializeDocumentActivityType(&sv.ActivityType, value); err != nil { return err } case "input": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Data to be of type string, got %T instead", value) } sv.Input = ptr.String(jtv) } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "taskToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskToken to be of type string, got %T instead", value) } sv.TaskToken = ptr.String(jtv) } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentPollForDecisionTaskOutput(v **PollForDecisionTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PollForDecisionTaskOutput if *v == nil { sv = &PollForDecisionTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { case "events": if err := awsAwsjson10_deserializeDocumentHistoryEventList(&sv.Events, value); err != nil { return err } case "nextPageToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) } sv.NextPageToken = ptr.String(jtv) } case "previousStartedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PreviousStartedEventId = i64 } case "startedEventId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EventId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartedEventId = i64 } case "taskToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaskToken to be of type string, got %T instead", value) } sv.TaskToken = ptr.String(jtv) } case "workflowExecution": if err := awsAwsjson10_deserializeDocumentWorkflowExecution(&sv.WorkflowExecution, value); err != nil { return err } case "workflowType": if err := awsAwsjson10_deserializeDocumentWorkflowType(&sv.WorkflowType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentRecordActivityTaskHeartbeatOutput(v **RecordActivityTaskHeartbeatOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RecordActivityTaskHeartbeatOutput if *v == nil { sv = &RecordActivityTaskHeartbeatOutput{} } else { sv = *v } for key, value := range shape { switch key { case "cancelRequested": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Canceled to be of type *bool, got %T instead", value) } sv.CancelRequested = jtv } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentStartWorkflowExecutionOutput(v **StartWorkflowExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartWorkflowExecutionOutput if *v == nil { sv = &StartWorkflowExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "runId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowRunId to be of type string, got %T instead", value) } sv.RunId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
10,937
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package swf provides the API client, operations, and parameter types for Amazon // Simple Workflow Service. // // Amazon Simple Workflow Service The Amazon Simple Workflow Service (Amazon SWF) // makes it easy to build applications that use Amazon's cloud to coordinate work // across distributed components. In Amazon SWF, a task represents a logical unit // of work that is performed by a component of your workflow. Coordinating tasks in // a workflow involves managing intertask dependencies, scheduling, and concurrency // in accordance with the logical flow of the application. Amazon SWF gives you // full control over implementing tasks and coordinating them without worrying // about underlying complexities such as tracking their progress and maintaining // their state. This documentation serves as reference only. For a broader overview // of the Amazon SWF programming model, see the Amazon SWF Developer Guide (https://docs.aws.amazon.com/amazonswf/latest/developerguide/) // . package swf
18
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf 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/swf/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 = "swf" } 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 swf // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/swf/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 awsAwsjson10_serializeOpCountClosedWorkflowExecutions struct { } func (*awsAwsjson10_serializeOpCountClosedWorkflowExecutions) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCountClosedWorkflowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CountClosedWorkflowExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.CountClosedWorkflowExecutions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCountClosedWorkflowExecutionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCountOpenWorkflowExecutions struct { } func (*awsAwsjson10_serializeOpCountOpenWorkflowExecutions) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCountOpenWorkflowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CountOpenWorkflowExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.CountOpenWorkflowExecutions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCountOpenWorkflowExecutionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCountPendingActivityTasks struct { } func (*awsAwsjson10_serializeOpCountPendingActivityTasks) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCountPendingActivityTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CountPendingActivityTasksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.CountPendingActivityTasks") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCountPendingActivityTasksInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCountPendingDecisionTasks struct { } func (*awsAwsjson10_serializeOpCountPendingDecisionTasks) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCountPendingDecisionTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CountPendingDecisionTasksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.CountPendingDecisionTasks") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCountPendingDecisionTasksInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeprecateActivityType struct { } func (*awsAwsjson10_serializeOpDeprecateActivityType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeprecateActivityType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeprecateActivityTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DeprecateActivityType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeprecateActivityTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeprecateDomain struct { } func (*awsAwsjson10_serializeOpDeprecateDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeprecateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeprecateDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DeprecateDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeprecateDomainInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeprecateWorkflowType struct { } func (*awsAwsjson10_serializeOpDeprecateWorkflowType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeprecateWorkflowType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeprecateWorkflowTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DeprecateWorkflowType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeprecateWorkflowTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDescribeActivityType struct { } func (*awsAwsjson10_serializeOpDescribeActivityType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDescribeActivityType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeActivityTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DescribeActivityType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDescribeActivityTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDescribeDomain struct { } func (*awsAwsjson10_serializeOpDescribeDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDescribeDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DescribeDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDescribeDomainInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDescribeWorkflowExecution struct { } func (*awsAwsjson10_serializeOpDescribeWorkflowExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDescribeWorkflowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorkflowExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DescribeWorkflowExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDescribeWorkflowExecutionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDescribeWorkflowType struct { } func (*awsAwsjson10_serializeOpDescribeWorkflowType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDescribeWorkflowType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorkflowTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.DescribeWorkflowType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDescribeWorkflowTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetWorkflowExecutionHistory struct { } func (*awsAwsjson10_serializeOpGetWorkflowExecutionHistory) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetWorkflowExecutionHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetWorkflowExecutionHistoryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.GetWorkflowExecutionHistory") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetWorkflowExecutionHistoryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListActivityTypes struct { } func (*awsAwsjson10_serializeOpListActivityTypes) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListActivityTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListActivityTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListActivityTypes") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListActivityTypesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListClosedWorkflowExecutions struct { } func (*awsAwsjson10_serializeOpListClosedWorkflowExecutions) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListClosedWorkflowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListClosedWorkflowExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListClosedWorkflowExecutions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListClosedWorkflowExecutionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListDomains struct { } func (*awsAwsjson10_serializeOpListDomains) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDomainsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListDomains") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListDomainsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListOpenWorkflowExecutions struct { } func (*awsAwsjson10_serializeOpListOpenWorkflowExecutions) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListOpenWorkflowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListOpenWorkflowExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListOpenWorkflowExecutions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListOpenWorkflowExecutionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListTagsForResource struct { } func (*awsAwsjson10_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListTagsForResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_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 awsAwsjson10_serializeOpListWorkflowTypes struct { } func (*awsAwsjson10_serializeOpListWorkflowTypes) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListWorkflowTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorkflowTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.ListWorkflowTypes") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListWorkflowTypesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpPollForActivityTask struct { } func (*awsAwsjson10_serializeOpPollForActivityTask) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpPollForActivityTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PollForActivityTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.PollForActivityTask") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentPollForActivityTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpPollForDecisionTask struct { } func (*awsAwsjson10_serializeOpPollForDecisionTask) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpPollForDecisionTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PollForDecisionTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.PollForDecisionTask") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentPollForDecisionTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRecordActivityTaskHeartbeat struct { } func (*awsAwsjson10_serializeOpRecordActivityTaskHeartbeat) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRecordActivityTaskHeartbeat) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RecordActivityTaskHeartbeatInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RecordActivityTaskHeartbeat") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRecordActivityTaskHeartbeatInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRegisterActivityType struct { } func (*awsAwsjson10_serializeOpRegisterActivityType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRegisterActivityType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterActivityTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RegisterActivityType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRegisterActivityTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRegisterDomain struct { } func (*awsAwsjson10_serializeOpRegisterDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRegisterDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RegisterDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRegisterDomainInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRegisterWorkflowType struct { } func (*awsAwsjson10_serializeOpRegisterWorkflowType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRegisterWorkflowType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterWorkflowTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RegisterWorkflowType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRegisterWorkflowTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRequestCancelWorkflowExecution struct { } func (*awsAwsjson10_serializeOpRequestCancelWorkflowExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRequestCancelWorkflowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RequestCancelWorkflowExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RequestCancelWorkflowExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRequestCancelWorkflowExecutionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRespondActivityTaskCanceled struct { } func (*awsAwsjson10_serializeOpRespondActivityTaskCanceled) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRespondActivityTaskCanceled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RespondActivityTaskCanceledInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RespondActivityTaskCanceled") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRespondActivityTaskCanceledInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRespondActivityTaskCompleted struct { } func (*awsAwsjson10_serializeOpRespondActivityTaskCompleted) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRespondActivityTaskCompleted) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RespondActivityTaskCompletedInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RespondActivityTaskCompleted") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRespondActivityTaskCompletedInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRespondActivityTaskFailed struct { } func (*awsAwsjson10_serializeOpRespondActivityTaskFailed) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRespondActivityTaskFailed) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RespondActivityTaskFailedInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RespondActivityTaskFailed") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRespondActivityTaskFailedInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpRespondDecisionTaskCompleted struct { } func (*awsAwsjson10_serializeOpRespondDecisionTaskCompleted) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpRespondDecisionTaskCompleted) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RespondDecisionTaskCompletedInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.RespondDecisionTaskCompleted") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentRespondDecisionTaskCompletedInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpSignalWorkflowExecution struct { } func (*awsAwsjson10_serializeOpSignalWorkflowExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpSignalWorkflowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*SignalWorkflowExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.SignalWorkflowExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentSignalWorkflowExecutionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpStartWorkflowExecution struct { } func (*awsAwsjson10_serializeOpStartWorkflowExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpStartWorkflowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartWorkflowExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.StartWorkflowExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentStartWorkflowExecutionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpTagResource struct { } func (*awsAwsjson10_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.TagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_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 awsAwsjson10_serializeOpTerminateWorkflowExecution struct { } func (*awsAwsjson10_serializeOpTerminateWorkflowExecution) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpTerminateWorkflowExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TerminateWorkflowExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.TerminateWorkflowExecution") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentTerminateWorkflowExecutionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUndeprecateActivityType struct { } func (*awsAwsjson10_serializeOpUndeprecateActivityType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUndeprecateActivityType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UndeprecateActivityTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.UndeprecateActivityType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUndeprecateActivityTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUndeprecateDomain struct { } func (*awsAwsjson10_serializeOpUndeprecateDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUndeprecateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UndeprecateDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.UndeprecateDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUndeprecateDomainInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUndeprecateWorkflowType struct { } func (*awsAwsjson10_serializeOpUndeprecateWorkflowType) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUndeprecateWorkflowType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UndeprecateWorkflowTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.UndeprecateWorkflowType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUndeprecateWorkflowTypeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUntagResource struct { } func (*awsAwsjson10_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("SimpleWorkflowService.UntagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_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) } func awsAwsjson10_serializeDocumentActivityType(v *types.ActivityType, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsAwsjson10_serializeDocumentCancelTimerDecisionAttributes(v *types.CancelTimerDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TimerId != nil { ok := object.Key("timerId") ok.String(*v.TimerId) } return nil } func awsAwsjson10_serializeDocumentCancelWorkflowExecutionDecisionAttributes(v *types.CancelWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } return nil } func awsAwsjson10_serializeDocumentCloseStatusFilter(v *types.CloseStatusFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } func awsAwsjson10_serializeDocumentCompleteWorkflowExecutionDecisionAttributes(v *types.CompleteWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Result != nil { ok := object.Key("result") ok.String(*v.Result) } return nil } func awsAwsjson10_serializeDocumentContinueAsNewWorkflowExecutionDecisionAttributes(v *types.ContinueAsNewWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ChildPolicy) > 0 { ok := object.Key("childPolicy") ok.String(string(v.ChildPolicy)) } if v.ExecutionStartToCloseTimeout != nil { ok := object.Key("executionStartToCloseTimeout") ok.String(*v.ExecutionStartToCloseTimeout) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.LambdaRole != nil { ok := object.Key("lambdaRole") ok.String(*v.LambdaRole) } if v.TagList != nil { ok := object.Key("tagList") if err := awsAwsjson10_serializeDocumentTagList(v.TagList, ok); err != nil { return err } } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } if v.TaskPriority != nil { ok := object.Key("taskPriority") ok.String(*v.TaskPriority) } if v.TaskStartToCloseTimeout != nil { ok := object.Key("taskStartToCloseTimeout") ok.String(*v.TaskStartToCloseTimeout) } if v.WorkflowTypeVersion != nil { ok := object.Key("workflowTypeVersion") ok.String(*v.WorkflowTypeVersion) } return nil } func awsAwsjson10_serializeDocumentDecision(v *types.Decision, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CancelTimerDecisionAttributes != nil { ok := object.Key("cancelTimerDecisionAttributes") if err := awsAwsjson10_serializeDocumentCancelTimerDecisionAttributes(v.CancelTimerDecisionAttributes, ok); err != nil { return err } } if v.CancelWorkflowExecutionDecisionAttributes != nil { ok := object.Key("cancelWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentCancelWorkflowExecutionDecisionAttributes(v.CancelWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.CompleteWorkflowExecutionDecisionAttributes != nil { ok := object.Key("completeWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentCompleteWorkflowExecutionDecisionAttributes(v.CompleteWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil { ok := object.Key("continueAsNewWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentContinueAsNewWorkflowExecutionDecisionAttributes(v.ContinueAsNewWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if len(v.DecisionType) > 0 { ok := object.Key("decisionType") ok.String(string(v.DecisionType)) } if v.FailWorkflowExecutionDecisionAttributes != nil { ok := object.Key("failWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentFailWorkflowExecutionDecisionAttributes(v.FailWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.RecordMarkerDecisionAttributes != nil { ok := object.Key("recordMarkerDecisionAttributes") if err := awsAwsjson10_serializeDocumentRecordMarkerDecisionAttributes(v.RecordMarkerDecisionAttributes, ok); err != nil { return err } } if v.RequestCancelActivityTaskDecisionAttributes != nil { ok := object.Key("requestCancelActivityTaskDecisionAttributes") if err := awsAwsjson10_serializeDocumentRequestCancelActivityTaskDecisionAttributes(v.RequestCancelActivityTaskDecisionAttributes, ok); err != nil { return err } } if v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil { ok := object.Key("requestCancelExternalWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentRequestCancelExternalWorkflowExecutionDecisionAttributes(v.RequestCancelExternalWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.ScheduleActivityTaskDecisionAttributes != nil { ok := object.Key("scheduleActivityTaskDecisionAttributes") if err := awsAwsjson10_serializeDocumentScheduleActivityTaskDecisionAttributes(v.ScheduleActivityTaskDecisionAttributes, ok); err != nil { return err } } if v.ScheduleLambdaFunctionDecisionAttributes != nil { ok := object.Key("scheduleLambdaFunctionDecisionAttributes") if err := awsAwsjson10_serializeDocumentScheduleLambdaFunctionDecisionAttributes(v.ScheduleLambdaFunctionDecisionAttributes, ok); err != nil { return err } } if v.SignalExternalWorkflowExecutionDecisionAttributes != nil { ok := object.Key("signalExternalWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentSignalExternalWorkflowExecutionDecisionAttributes(v.SignalExternalWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.StartChildWorkflowExecutionDecisionAttributes != nil { ok := object.Key("startChildWorkflowExecutionDecisionAttributes") if err := awsAwsjson10_serializeDocumentStartChildWorkflowExecutionDecisionAttributes(v.StartChildWorkflowExecutionDecisionAttributes, ok); err != nil { return err } } if v.StartTimerDecisionAttributes != nil { ok := object.Key("startTimerDecisionAttributes") if err := awsAwsjson10_serializeDocumentStartTimerDecisionAttributes(v.StartTimerDecisionAttributes, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentDecisionList(v []types.Decision, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson10_serializeDocumentDecision(&v[i], av); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentExecutionTimeFilter(v *types.ExecutionTimeFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LatestDate != nil { ok := object.Key("latestDate") ok.Double(smithytime.FormatEpochSeconds(*v.LatestDate)) } if v.OldestDate != nil { ok := object.Key("oldestDate") ok.Double(smithytime.FormatEpochSeconds(*v.OldestDate)) } return nil } func awsAwsjson10_serializeDocumentFailWorkflowExecutionDecisionAttributes(v *types.FailWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.Reason != nil { ok := object.Key("reason") ok.String(*v.Reason) } return nil } func awsAwsjson10_serializeDocumentRecordMarkerDecisionAttributes(v *types.RecordMarkerDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.MarkerName != nil { ok := object.Key("markerName") ok.String(*v.MarkerName) } return nil } func awsAwsjson10_serializeDocumentRequestCancelActivityTaskDecisionAttributes(v *types.RequestCancelActivityTaskDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActivityId != nil { ok := object.Key("activityId") ok.String(*v.ActivityId) } return nil } func awsAwsjson10_serializeDocumentRequestCancelExternalWorkflowExecutionDecisionAttributes(v *types.RequestCancelExternalWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeDocumentResourceTag(v *types.ResourceTag, 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 awsAwsjson10_serializeDocumentResourceTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson10_serializeDocumentResourceTagList(v []types.ResourceTag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson10_serializeDocumentResourceTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentScheduleActivityTaskDecisionAttributes(v *types.ScheduleActivityTaskDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActivityId != nil { ok := object.Key("activityId") ok.String(*v.ActivityId) } if v.ActivityType != nil { ok := object.Key("activityType") if err := awsAwsjson10_serializeDocumentActivityType(v.ActivityType, ok); err != nil { return err } } if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.HeartbeatTimeout != nil { ok := object.Key("heartbeatTimeout") ok.String(*v.HeartbeatTimeout) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.ScheduleToCloseTimeout != nil { ok := object.Key("scheduleToCloseTimeout") ok.String(*v.ScheduleToCloseTimeout) } if v.ScheduleToStartTimeout != nil { ok := object.Key("scheduleToStartTimeout") ok.String(*v.ScheduleToStartTimeout) } if v.StartToCloseTimeout != nil { ok := object.Key("startToCloseTimeout") ok.String(*v.StartToCloseTimeout) } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } if v.TaskPriority != nil { ok := object.Key("taskPriority") ok.String(*v.TaskPriority) } return nil } func awsAwsjson10_serializeDocumentScheduleLambdaFunctionDecisionAttributes(v *types.ScheduleLambdaFunctionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.StartToCloseTimeout != nil { ok := object.Key("startToCloseTimeout") ok.String(*v.StartToCloseTimeout) } return nil } func awsAwsjson10_serializeDocumentSignalExternalWorkflowExecutionDecisionAttributes(v *types.SignalExternalWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.SignalName != nil { ok := object.Key("signalName") ok.String(*v.SignalName) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeDocumentStartChildWorkflowExecutionDecisionAttributes(v *types.StartChildWorkflowExecutionDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ChildPolicy) > 0 { ok := object.Key("childPolicy") ok.String(string(v.ChildPolicy)) } if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.ExecutionStartToCloseTimeout != nil { ok := object.Key("executionStartToCloseTimeout") ok.String(*v.ExecutionStartToCloseTimeout) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.LambdaRole != nil { ok := object.Key("lambdaRole") ok.String(*v.LambdaRole) } if v.TagList != nil { ok := object.Key("tagList") if err := awsAwsjson10_serializeDocumentTagList(v.TagList, ok); err != nil { return err } } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } if v.TaskPriority != nil { ok := object.Key("taskPriority") ok.String(*v.TaskPriority) } if v.TaskStartToCloseTimeout != nil { ok := object.Key("taskStartToCloseTimeout") ok.String(*v.TaskStartToCloseTimeout) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } if v.WorkflowType != nil { ok := object.Key("workflowType") if err := awsAwsjson10_serializeDocumentWorkflowType(v.WorkflowType, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentStartTimerDecisionAttributes(v *types.StartTimerDecisionAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Control != nil { ok := object.Key("control") ok.String(*v.Control) } if v.StartToFireTimeout != nil { ok := object.Key("startToFireTimeout") ok.String(*v.StartToFireTimeout) } if v.TimerId != nil { ok := object.Key("timerId") ok.String(*v.TimerId) } return nil } func awsAwsjson10_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tag != nil { ok := object.Key("tag") ok.String(*v.Tag) } return nil } func awsAwsjson10_serializeDocumentTagList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson10_serializeDocumentTaskList(v *types.TaskList, 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 awsAwsjson10_serializeDocumentWorkflowExecution(v *types.WorkflowExecution, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeDocumentWorkflowExecutionFilter(v *types.WorkflowExecutionFilter, 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 awsAwsjson10_serializeDocumentWorkflowType(v *types.WorkflowType, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsAwsjson10_serializeDocumentWorkflowTypeFilter(v *types.WorkflowTypeFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsAwsjson10_serializeOpDocumentCountClosedWorkflowExecutionsInput(v *CountClosedWorkflowExecutionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloseStatusFilter != nil { ok := object.Key("closeStatusFilter") if err := awsAwsjson10_serializeDocumentCloseStatusFilter(v.CloseStatusFilter, ok); err != nil { return err } } if v.CloseTimeFilter != nil { ok := object.Key("closeTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.CloseTimeFilter, ok); err != nil { return err } } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.ExecutionFilter != nil { ok := object.Key("executionFilter") if err := awsAwsjson10_serializeDocumentWorkflowExecutionFilter(v.ExecutionFilter, ok); err != nil { return err } } if v.StartTimeFilter != nil { ok := object.Key("startTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.StartTimeFilter, ok); err != nil { return err } } if v.TagFilter != nil { ok := object.Key("tagFilter") if err := awsAwsjson10_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { return err } } if v.TypeFilter != nil { ok := object.Key("typeFilter") if err := awsAwsjson10_serializeDocumentWorkflowTypeFilter(v.TypeFilter, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentCountOpenWorkflowExecutionsInput(v *CountOpenWorkflowExecutionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.ExecutionFilter != nil { ok := object.Key("executionFilter") if err := awsAwsjson10_serializeDocumentWorkflowExecutionFilter(v.ExecutionFilter, ok); err != nil { return err } } if v.StartTimeFilter != nil { ok := object.Key("startTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.StartTimeFilter, ok); err != nil { return err } } if v.TagFilter != nil { ok := object.Key("tagFilter") if err := awsAwsjson10_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { return err } } if v.TypeFilter != nil { ok := object.Key("typeFilter") if err := awsAwsjson10_serializeDocumentWorkflowTypeFilter(v.TypeFilter, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentCountPendingActivityTasksInput(v *CountPendingActivityTasksInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentCountPendingDecisionTasksInput(v *CountPendingDecisionTasksInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentDeprecateActivityTypeInput(v *DeprecateActivityTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActivityType != nil { ok := object.Key("activityType") if err := awsAwsjson10_serializeDocumentActivityType(v.ActivityType, ok); err != nil { return err } } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } return nil } func awsAwsjson10_serializeOpDocumentDeprecateDomainInput(v *DeprecateDomainInput, 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 awsAwsjson10_serializeOpDocumentDeprecateWorkflowTypeInput(v *DeprecateWorkflowTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.WorkflowType != nil { ok := object.Key("workflowType") if err := awsAwsjson10_serializeDocumentWorkflowType(v.WorkflowType, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentDescribeActivityTypeInput(v *DescribeActivityTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActivityType != nil { ok := object.Key("activityType") if err := awsAwsjson10_serializeDocumentActivityType(v.ActivityType, ok); err != nil { return err } } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } return nil } func awsAwsjson10_serializeOpDocumentDescribeDomainInput(v *DescribeDomainInput, 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 awsAwsjson10_serializeOpDocumentDescribeWorkflowExecutionInput(v *DescribeWorkflowExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Execution != nil { ok := object.Key("execution") if err := awsAwsjson10_serializeDocumentWorkflowExecution(v.Execution, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentDescribeWorkflowTypeInput(v *DescribeWorkflowTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.WorkflowType != nil { ok := object.Key("workflowType") if err := awsAwsjson10_serializeDocumentWorkflowType(v.WorkflowType, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentGetWorkflowExecutionHistoryInput(v *GetWorkflowExecutionHistoryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Execution != nil { ok := object.Key("execution") if err := awsAwsjson10_serializeDocumentWorkflowExecution(v.Execution, ok); err != nil { return err } } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } return nil } func awsAwsjson10_serializeOpDocumentListActivityTypesInput(v *ListActivityTypesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if len(v.RegistrationStatus) > 0 { ok := object.Key("registrationStatus") ok.String(string(v.RegistrationStatus)) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } return nil } func awsAwsjson10_serializeOpDocumentListClosedWorkflowExecutionsInput(v *ListClosedWorkflowExecutionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloseStatusFilter != nil { ok := object.Key("closeStatusFilter") if err := awsAwsjson10_serializeDocumentCloseStatusFilter(v.CloseStatusFilter, ok); err != nil { return err } } if v.CloseTimeFilter != nil { ok := object.Key("closeTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.CloseTimeFilter, ok); err != nil { return err } } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.ExecutionFilter != nil { ok := object.Key("executionFilter") if err := awsAwsjson10_serializeDocumentWorkflowExecutionFilter(v.ExecutionFilter, ok); err != nil { return err } } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } if v.StartTimeFilter != nil { ok := object.Key("startTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.StartTimeFilter, ok); err != nil { return err } } if v.TagFilter != nil { ok := object.Key("tagFilter") if err := awsAwsjson10_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { return err } } if v.TypeFilter != nil { ok := object.Key("typeFilter") if err := awsAwsjson10_serializeDocumentWorkflowTypeFilter(v.TypeFilter, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentListDomainsInput(v *ListDomainsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if len(v.RegistrationStatus) > 0 { ok := object.Key("registrationStatus") ok.String(string(v.RegistrationStatus)) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } return nil } func awsAwsjson10_serializeOpDocumentListOpenWorkflowExecutionsInput(v *ListOpenWorkflowExecutionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.ExecutionFilter != nil { ok := object.Key("executionFilter") if err := awsAwsjson10_serializeDocumentWorkflowExecutionFilter(v.ExecutionFilter, ok); err != nil { return err } } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } if v.StartTimeFilter != nil { ok := object.Key("startTimeFilter") if err := awsAwsjson10_serializeDocumentExecutionTimeFilter(v.StartTimeFilter, ok); err != nil { return err } } if v.TagFilter != nil { ok := object.Key("tagFilter") if err := awsAwsjson10_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { return err } } if v.TypeFilter != nil { ok := object.Key("typeFilter") if err := awsAwsjson10_serializeDocumentWorkflowTypeFilter(v.TypeFilter, ok); err != nil { return err } } return nil } func awsAwsjson10_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 awsAwsjson10_serializeOpDocumentListWorkflowTypesInput(v *ListWorkflowTypesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if len(v.RegistrationStatus) > 0 { ok := object.Key("registrationStatus") ok.String(string(v.RegistrationStatus)) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } return nil } func awsAwsjson10_serializeOpDocumentPollForActivityTaskInput(v *PollForActivityTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Identity != nil { ok := object.Key("identity") ok.String(*v.Identity) } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentPollForDecisionTaskInput(v *PollForDecisionTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Identity != nil { ok := object.Key("identity") ok.String(*v.Identity) } if v.MaximumPageSize != 0 { ok := object.Key("maximumPageSize") ok.Integer(v.MaximumPageSize) } if v.NextPageToken != nil { ok := object.Key("nextPageToken") ok.String(*v.NextPageToken) } if v.ReverseOrder { ok := object.Key("reverseOrder") ok.Boolean(v.ReverseOrder) } if v.StartAtPreviousStartedEvent { ok := object.Key("startAtPreviousStartedEvent") ok.Boolean(v.StartAtPreviousStartedEvent) } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentRecordActivityTaskHeartbeatInput(v *RecordActivityTaskHeartbeatInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.TaskToken != nil { ok := object.Key("taskToken") ok.String(*v.TaskToken) } return nil } func awsAwsjson10_serializeOpDocumentRegisterActivityTypeInput(v *RegisterActivityTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DefaultTaskHeartbeatTimeout != nil { ok := object.Key("defaultTaskHeartbeatTimeout") ok.String(*v.DefaultTaskHeartbeatTimeout) } if v.DefaultTaskList != nil { ok := object.Key("defaultTaskList") if err := awsAwsjson10_serializeDocumentTaskList(v.DefaultTaskList, ok); err != nil { return err } } if v.DefaultTaskPriority != nil { ok := object.Key("defaultTaskPriority") ok.String(*v.DefaultTaskPriority) } if v.DefaultTaskScheduleToCloseTimeout != nil { ok := object.Key("defaultTaskScheduleToCloseTimeout") ok.String(*v.DefaultTaskScheduleToCloseTimeout) } if v.DefaultTaskScheduleToStartTimeout != nil { ok := object.Key("defaultTaskScheduleToStartTimeout") ok.String(*v.DefaultTaskScheduleToStartTimeout) } if v.DefaultTaskStartToCloseTimeout != nil { ok := object.Key("defaultTaskStartToCloseTimeout") ok.String(*v.DefaultTaskStartToCloseTimeout) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsAwsjson10_serializeOpDocumentRegisterDomainInput(v *RegisterDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson10_serializeDocumentResourceTagList(v.Tags, ok); err != nil { return err } } if v.WorkflowExecutionRetentionPeriodInDays != nil { ok := object.Key("workflowExecutionRetentionPeriodInDays") ok.String(*v.WorkflowExecutionRetentionPeriodInDays) } return nil } func awsAwsjson10_serializeOpDocumentRegisterWorkflowTypeInput(v *RegisterWorkflowTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DefaultChildPolicy) > 0 { ok := object.Key("defaultChildPolicy") ok.String(string(v.DefaultChildPolicy)) } if v.DefaultExecutionStartToCloseTimeout != nil { ok := object.Key("defaultExecutionStartToCloseTimeout") ok.String(*v.DefaultExecutionStartToCloseTimeout) } if v.DefaultLambdaRole != nil { ok := object.Key("defaultLambdaRole") ok.String(*v.DefaultLambdaRole) } if v.DefaultTaskList != nil { ok := object.Key("defaultTaskList") if err := awsAwsjson10_serializeDocumentTaskList(v.DefaultTaskList, ok); err != nil { return err } } if v.DefaultTaskPriority != nil { ok := object.Key("defaultTaskPriority") ok.String(*v.DefaultTaskPriority) } if v.DefaultTaskStartToCloseTimeout != nil { ok := object.Key("defaultTaskStartToCloseTimeout") ok.String(*v.DefaultTaskStartToCloseTimeout) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsAwsjson10_serializeOpDocumentRequestCancelWorkflowExecutionInput(v *RequestCancelWorkflowExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeOpDocumentRespondActivityTaskCanceledInput(v *RespondActivityTaskCanceledInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.TaskToken != nil { ok := object.Key("taskToken") ok.String(*v.TaskToken) } return nil } func awsAwsjson10_serializeOpDocumentRespondActivityTaskCompletedInput(v *RespondActivityTaskCompletedInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Result != nil { ok := object.Key("result") ok.String(*v.Result) } if v.TaskToken != nil { ok := object.Key("taskToken") ok.String(*v.TaskToken) } return nil } func awsAwsjson10_serializeOpDocumentRespondActivityTaskFailedInput(v *RespondActivityTaskFailedInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.Reason != nil { ok := object.Key("reason") ok.String(*v.Reason) } if v.TaskToken != nil { ok := object.Key("taskToken") ok.String(*v.TaskToken) } return nil } func awsAwsjson10_serializeOpDocumentRespondDecisionTaskCompletedInput(v *RespondDecisionTaskCompletedInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Decisions != nil { ok := object.Key("decisions") if err := awsAwsjson10_serializeDocumentDecisionList(v.Decisions, ok); err != nil { return err } } if v.ExecutionContext != nil { ok := object.Key("executionContext") ok.String(*v.ExecutionContext) } if v.TaskToken != nil { ok := object.Key("taskToken") ok.String(*v.TaskToken) } return nil } func awsAwsjson10_serializeOpDocumentSignalWorkflowExecutionInput(v *SignalWorkflowExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.SignalName != nil { ok := object.Key("signalName") ok.String(*v.SignalName) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeOpDocumentStartWorkflowExecutionInput(v *StartWorkflowExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ChildPolicy) > 0 { ok := object.Key("childPolicy") ok.String(string(v.ChildPolicy)) } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.ExecutionStartToCloseTimeout != nil { ok := object.Key("executionStartToCloseTimeout") ok.String(*v.ExecutionStartToCloseTimeout) } if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) } if v.LambdaRole != nil { ok := object.Key("lambdaRole") ok.String(*v.LambdaRole) } if v.TagList != nil { ok := object.Key("tagList") if err := awsAwsjson10_serializeDocumentTagList(v.TagList, ok); err != nil { return err } } if v.TaskList != nil { ok := object.Key("taskList") if err := awsAwsjson10_serializeDocumentTaskList(v.TaskList, ok); err != nil { return err } } if v.TaskPriority != nil { ok := object.Key("taskPriority") ok.String(*v.TaskPriority) } if v.TaskStartToCloseTimeout != nil { ok := object.Key("taskStartToCloseTimeout") ok.String(*v.TaskStartToCloseTimeout) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } if v.WorkflowType != nil { ok := object.Key("workflowType") if err := awsAwsjson10_serializeDocumentWorkflowType(v.WorkflowType, ok); err != nil { return err } } return nil } func awsAwsjson10_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 := awsAwsjson10_serializeDocumentResourceTagList(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentTerminateWorkflowExecutionInput(v *TerminateWorkflowExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ChildPolicy) > 0 { ok := object.Key("childPolicy") ok.String(string(v.ChildPolicy)) } if v.Details != nil { ok := object.Key("details") ok.String(*v.Details) } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.Reason != nil { ok := object.Key("reason") ok.String(*v.Reason) } if v.RunId != nil { ok := object.Key("runId") ok.String(*v.RunId) } if v.WorkflowId != nil { ok := object.Key("workflowId") ok.String(*v.WorkflowId) } return nil } func awsAwsjson10_serializeOpDocumentUndeprecateActivityTypeInput(v *UndeprecateActivityTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActivityType != nil { ok := object.Key("activityType") if err := awsAwsjson10_serializeDocumentActivityType(v.ActivityType, ok); err != nil { return err } } if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } return nil } func awsAwsjson10_serializeOpDocumentUndeprecateDomainInput(v *UndeprecateDomainInput, 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 awsAwsjson10_serializeOpDocumentUndeprecateWorkflowTypeInput(v *UndeprecateWorkflowTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Domain != nil { ok := object.Key("domain") ok.String(*v.Domain) } if v.WorkflowType != nil { ok := object.Key("workflowType") if err := awsAwsjson10_serializeDocumentWorkflowType(v.WorkflowType, ok); err != nil { return err } } return nil } func awsAwsjson10_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 := awsAwsjson10_serializeDocumentResourceTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil }
3,809
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package swf import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/swf/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCountClosedWorkflowExecutions struct { } func (*validateOpCountClosedWorkflowExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpCountClosedWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CountClosedWorkflowExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCountClosedWorkflowExecutionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCountOpenWorkflowExecutions struct { } func (*validateOpCountOpenWorkflowExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpCountOpenWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CountOpenWorkflowExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCountOpenWorkflowExecutionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCountPendingActivityTasks struct { } func (*validateOpCountPendingActivityTasks) ID() string { return "OperationInputValidation" } func (m *validateOpCountPendingActivityTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CountPendingActivityTasksInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCountPendingActivityTasksInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCountPendingDecisionTasks struct { } func (*validateOpCountPendingDecisionTasks) ID() string { return "OperationInputValidation" } func (m *validateOpCountPendingDecisionTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CountPendingDecisionTasksInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCountPendingDecisionTasksInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeprecateActivityType struct { } func (*validateOpDeprecateActivityType) ID() string { return "OperationInputValidation" } func (m *validateOpDeprecateActivityType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeprecateActivityTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeprecateActivityTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeprecateDomain struct { } func (*validateOpDeprecateDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDeprecateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeprecateDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeprecateDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeprecateWorkflowType struct { } func (*validateOpDeprecateWorkflowType) ID() string { return "OperationInputValidation" } func (m *validateOpDeprecateWorkflowType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeprecateWorkflowTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeprecateWorkflowTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeActivityType struct { } func (*validateOpDescribeActivityType) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeActivityType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeActivityTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeActivityTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomain struct { } func (*validateOpDescribeDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorkflowExecution struct { } func (*validateOpDescribeWorkflowExecution) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorkflowExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorkflowExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorkflowType struct { } func (*validateOpDescribeWorkflowType) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorkflowType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorkflowTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorkflowTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetWorkflowExecutionHistory struct { } func (*validateOpGetWorkflowExecutionHistory) ID() string { return "OperationInputValidation" } func (m *validateOpGetWorkflowExecutionHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetWorkflowExecutionHistoryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetWorkflowExecutionHistoryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListActivityTypes struct { } func (*validateOpListActivityTypes) ID() string { return "OperationInputValidation" } func (m *validateOpListActivityTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListActivityTypesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListActivityTypesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListClosedWorkflowExecutions struct { } func (*validateOpListClosedWorkflowExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpListClosedWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListClosedWorkflowExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListClosedWorkflowExecutionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDomains struct { } func (*validateOpListDomains) ID() string { return "OperationInputValidation" } func (m *validateOpListDomains) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDomainsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDomainsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListOpenWorkflowExecutions struct { } func (*validateOpListOpenWorkflowExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpListOpenWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListOpenWorkflowExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListOpenWorkflowExecutionsInput(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 validateOpListWorkflowTypes struct { } func (*validateOpListWorkflowTypes) ID() string { return "OperationInputValidation" } func (m *validateOpListWorkflowTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListWorkflowTypesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListWorkflowTypesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPollForActivityTask struct { } func (*validateOpPollForActivityTask) ID() string { return "OperationInputValidation" } func (m *validateOpPollForActivityTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PollForActivityTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPollForActivityTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPollForDecisionTask struct { } func (*validateOpPollForDecisionTask) ID() string { return "OperationInputValidation" } func (m *validateOpPollForDecisionTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PollForDecisionTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPollForDecisionTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRecordActivityTaskHeartbeat struct { } func (*validateOpRecordActivityTaskHeartbeat) ID() string { return "OperationInputValidation" } func (m *validateOpRecordActivityTaskHeartbeat) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RecordActivityTaskHeartbeatInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRecordActivityTaskHeartbeatInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRegisterActivityType struct { } func (*validateOpRegisterActivityType) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterActivityType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterActivityTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterActivityTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRegisterDomain struct { } func (*validateOpRegisterDomain) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRegisterWorkflowType struct { } func (*validateOpRegisterWorkflowType) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterWorkflowType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterWorkflowTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterWorkflowTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRequestCancelWorkflowExecution struct { } func (*validateOpRequestCancelWorkflowExecution) ID() string { return "OperationInputValidation" } func (m *validateOpRequestCancelWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RequestCancelWorkflowExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRequestCancelWorkflowExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRespondActivityTaskCanceled struct { } func (*validateOpRespondActivityTaskCanceled) ID() string { return "OperationInputValidation" } func (m *validateOpRespondActivityTaskCanceled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RespondActivityTaskCanceledInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRespondActivityTaskCanceledInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRespondActivityTaskCompleted struct { } func (*validateOpRespondActivityTaskCompleted) ID() string { return "OperationInputValidation" } func (m *validateOpRespondActivityTaskCompleted) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RespondActivityTaskCompletedInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRespondActivityTaskCompletedInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRespondActivityTaskFailed struct { } func (*validateOpRespondActivityTaskFailed) ID() string { return "OperationInputValidation" } func (m *validateOpRespondActivityTaskFailed) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RespondActivityTaskFailedInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRespondActivityTaskFailedInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRespondDecisionTaskCompleted struct { } func (*validateOpRespondDecisionTaskCompleted) ID() string { return "OperationInputValidation" } func (m *validateOpRespondDecisionTaskCompleted) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RespondDecisionTaskCompletedInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRespondDecisionTaskCompletedInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSignalWorkflowExecution struct { } func (*validateOpSignalWorkflowExecution) ID() string { return "OperationInputValidation" } func (m *validateOpSignalWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SignalWorkflowExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSignalWorkflowExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartWorkflowExecution struct { } func (*validateOpStartWorkflowExecution) ID() string { return "OperationInputValidation" } func (m *validateOpStartWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartWorkflowExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartWorkflowExecutionInput(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 validateOpTerminateWorkflowExecution struct { } func (*validateOpTerminateWorkflowExecution) ID() string { return "OperationInputValidation" } func (m *validateOpTerminateWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TerminateWorkflowExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTerminateWorkflowExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUndeprecateActivityType struct { } func (*validateOpUndeprecateActivityType) ID() string { return "OperationInputValidation" } func (m *validateOpUndeprecateActivityType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UndeprecateActivityTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUndeprecateActivityTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUndeprecateDomain struct { } func (*validateOpUndeprecateDomain) ID() string { return "OperationInputValidation" } func (m *validateOpUndeprecateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UndeprecateDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUndeprecateDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUndeprecateWorkflowType struct { } func (*validateOpUndeprecateWorkflowType) ID() string { return "OperationInputValidation" } func (m *validateOpUndeprecateWorkflowType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UndeprecateWorkflowTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUndeprecateWorkflowTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCountClosedWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCountClosedWorkflowExecutions{}, middleware.After) } func addOpCountOpenWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCountOpenWorkflowExecutions{}, middleware.After) } func addOpCountPendingActivityTasksValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCountPendingActivityTasks{}, middleware.After) } func addOpCountPendingDecisionTasksValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCountPendingDecisionTasks{}, middleware.After) } func addOpDeprecateActivityTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeprecateActivityType{}, middleware.After) } func addOpDeprecateDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeprecateDomain{}, middleware.After) } func addOpDeprecateWorkflowTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeprecateWorkflowType{}, middleware.After) } func addOpDescribeActivityTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeActivityType{}, middleware.After) } func addOpDescribeDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomain{}, middleware.After) } func addOpDescribeWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkflowExecution{}, middleware.After) } func addOpDescribeWorkflowTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkflowType{}, middleware.After) } func addOpGetWorkflowExecutionHistoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetWorkflowExecutionHistory{}, middleware.After) } func addOpListActivityTypesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListActivityTypes{}, middleware.After) } func addOpListClosedWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListClosedWorkflowExecutions{}, middleware.After) } func addOpListDomainsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDomains{}, middleware.After) } func addOpListOpenWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOpenWorkflowExecutions{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpListWorkflowTypesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListWorkflowTypes{}, middleware.After) } func addOpPollForActivityTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPollForActivityTask{}, middleware.After) } func addOpPollForDecisionTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPollForDecisionTask{}, middleware.After) } func addOpRecordActivityTaskHeartbeatValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRecordActivityTaskHeartbeat{}, middleware.After) } func addOpRegisterActivityTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterActivityType{}, middleware.After) } func addOpRegisterDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterDomain{}, middleware.After) } func addOpRegisterWorkflowTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterWorkflowType{}, middleware.After) } func addOpRequestCancelWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRequestCancelWorkflowExecution{}, middleware.After) } func addOpRespondActivityTaskCanceledValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRespondActivityTaskCanceled{}, middleware.After) } func addOpRespondActivityTaskCompletedValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRespondActivityTaskCompleted{}, middleware.After) } func addOpRespondActivityTaskFailedValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRespondActivityTaskFailed{}, middleware.After) } func addOpRespondDecisionTaskCompletedValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRespondDecisionTaskCompleted{}, middleware.After) } func addOpSignalWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSignalWorkflowExecution{}, middleware.After) } func addOpStartWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartWorkflowExecution{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpTerminateWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTerminateWorkflowExecution{}, middleware.After) } func addOpUndeprecateActivityTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUndeprecateActivityType{}, middleware.After) } func addOpUndeprecateDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUndeprecateDomain{}, middleware.After) } func addOpUndeprecateWorkflowTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUndeprecateWorkflowType{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func validateActivityType(v *types.ActivityType) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ActivityType"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Version == nil { invalidParams.Add(smithy.NewErrParamRequired("Version")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCancelTimerDecisionAttributes(v *types.CancelTimerDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelTimerDecisionAttributes"} if v.TimerId == nil { invalidParams.Add(smithy.NewErrParamRequired("TimerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCloseStatusFilter(v *types.CloseStatusFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CloseStatusFilter"} if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateContinueAsNewWorkflowExecutionDecisionAttributes(v *types.ContinueAsNewWorkflowExecutionDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ContinueAsNewWorkflowExecutionDecisionAttributes"} if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDecision(v *types.Decision) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Decision"} if len(v.DecisionType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DecisionType")) } if v.ScheduleActivityTaskDecisionAttributes != nil { if err := validateScheduleActivityTaskDecisionAttributes(v.ScheduleActivityTaskDecisionAttributes); err != nil { invalidParams.AddNested("ScheduleActivityTaskDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.RequestCancelActivityTaskDecisionAttributes != nil { if err := validateRequestCancelActivityTaskDecisionAttributes(v.RequestCancelActivityTaskDecisionAttributes); err != nil { invalidParams.AddNested("RequestCancelActivityTaskDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil { if err := validateContinueAsNewWorkflowExecutionDecisionAttributes(v.ContinueAsNewWorkflowExecutionDecisionAttributes); err != nil { invalidParams.AddNested("ContinueAsNewWorkflowExecutionDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.RecordMarkerDecisionAttributes != nil { if err := validateRecordMarkerDecisionAttributes(v.RecordMarkerDecisionAttributes); err != nil { invalidParams.AddNested("RecordMarkerDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.StartTimerDecisionAttributes != nil { if err := validateStartTimerDecisionAttributes(v.StartTimerDecisionAttributes); err != nil { invalidParams.AddNested("StartTimerDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.CancelTimerDecisionAttributes != nil { if err := validateCancelTimerDecisionAttributes(v.CancelTimerDecisionAttributes); err != nil { invalidParams.AddNested("CancelTimerDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.SignalExternalWorkflowExecutionDecisionAttributes != nil { if err := validateSignalExternalWorkflowExecutionDecisionAttributes(v.SignalExternalWorkflowExecutionDecisionAttributes); err != nil { invalidParams.AddNested("SignalExternalWorkflowExecutionDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil { if err := validateRequestCancelExternalWorkflowExecutionDecisionAttributes(v.RequestCancelExternalWorkflowExecutionDecisionAttributes); err != nil { invalidParams.AddNested("RequestCancelExternalWorkflowExecutionDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.StartChildWorkflowExecutionDecisionAttributes != nil { if err := validateStartChildWorkflowExecutionDecisionAttributes(v.StartChildWorkflowExecutionDecisionAttributes); err != nil { invalidParams.AddNested("StartChildWorkflowExecutionDecisionAttributes", err.(smithy.InvalidParamsError)) } } if v.ScheduleLambdaFunctionDecisionAttributes != nil { if err := validateScheduleLambdaFunctionDecisionAttributes(v.ScheduleLambdaFunctionDecisionAttributes); err != nil { invalidParams.AddNested("ScheduleLambdaFunctionDecisionAttributes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDecisionList(v []types.Decision) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DecisionList"} for i := range v { if err := validateDecision(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateExecutionTimeFilter(v *types.ExecutionTimeFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ExecutionTimeFilter"} if v.OldestDate == nil { invalidParams.Add(smithy.NewErrParamRequired("OldestDate")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRecordMarkerDecisionAttributes(v *types.RecordMarkerDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RecordMarkerDecisionAttributes"} if v.MarkerName == nil { invalidParams.Add(smithy.NewErrParamRequired("MarkerName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRequestCancelActivityTaskDecisionAttributes(v *types.RequestCancelActivityTaskDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RequestCancelActivityTaskDecisionAttributes"} if v.ActivityId == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRequestCancelExternalWorkflowExecutionDecisionAttributes(v *types.RequestCancelExternalWorkflowExecutionDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RequestCancelExternalWorkflowExecutionDecisionAttributes"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateResourceTag(v *types.ResourceTag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResourceTag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateResourceTagList(v []types.ResourceTag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResourceTagList"} for i := range v { if err := validateResourceTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScheduleActivityTaskDecisionAttributes(v *types.ScheduleActivityTaskDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScheduleActivityTaskDecisionAttributes"} if v.ActivityType == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityType")) } else if v.ActivityType != nil { if err := validateActivityType(v.ActivityType); err != nil { invalidParams.AddNested("ActivityType", err.(smithy.InvalidParamsError)) } } if v.ActivityId == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityId")) } if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScheduleLambdaFunctionDecisionAttributes(v *types.ScheduleLambdaFunctionDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScheduleLambdaFunctionDecisionAttributes"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSignalExternalWorkflowExecutionDecisionAttributes(v *types.SignalExternalWorkflowExecutionDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SignalExternalWorkflowExecutionDecisionAttributes"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.SignalName == nil { invalidParams.Add(smithy.NewErrParamRequired("SignalName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateStartChildWorkflowExecutionDecisionAttributes(v *types.StartChildWorkflowExecutionDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartChildWorkflowExecutionDecisionAttributes"} if v.WorkflowType == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowType")) } else if v.WorkflowType != nil { if err := validateWorkflowType(v.WorkflowType); err != nil { invalidParams.AddNested("WorkflowType", err.(smithy.InvalidParamsError)) } } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateStartTimerDecisionAttributes(v *types.StartTimerDecisionAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartTimerDecisionAttributes"} if v.TimerId == nil { invalidParams.Add(smithy.NewErrParamRequired("TimerId")) } if v.StartToFireTimeout == nil { invalidParams.Add(smithy.NewErrParamRequired("StartToFireTimeout")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagFilter(v *types.TagFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagFilter"} if v.Tag == nil { invalidParams.Add(smithy.NewErrParamRequired("Tag")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTaskList(v *types.TaskList) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TaskList"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowExecution(v *types.WorkflowExecution) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowExecution"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.RunId == nil { invalidParams.Add(smithy.NewErrParamRequired("RunId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowExecutionFilter(v *types.WorkflowExecutionFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowExecutionFilter"} if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowType(v *types.WorkflowType) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowType"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Version == nil { invalidParams.Add(smithy.NewErrParamRequired("Version")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkflowTypeFilter(v *types.WorkflowTypeFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkflowTypeFilter"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCountClosedWorkflowExecutionsInput(v *CountClosedWorkflowExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CountClosedWorkflowExecutionsInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.StartTimeFilter != nil { if err := validateExecutionTimeFilter(v.StartTimeFilter); err != nil { invalidParams.AddNested("StartTimeFilter", err.(smithy.InvalidParamsError)) } } if v.CloseTimeFilter != nil { if err := validateExecutionTimeFilter(v.CloseTimeFilter); err != nil { invalidParams.AddNested("CloseTimeFilter", err.(smithy.InvalidParamsError)) } } if v.ExecutionFilter != nil { if err := validateWorkflowExecutionFilter(v.ExecutionFilter); err != nil { invalidParams.AddNested("ExecutionFilter", err.(smithy.InvalidParamsError)) } } if v.TypeFilter != nil { if err := validateWorkflowTypeFilter(v.TypeFilter); err != nil { invalidParams.AddNested("TypeFilter", err.(smithy.InvalidParamsError)) } } if v.TagFilter != nil { if err := validateTagFilter(v.TagFilter); err != nil { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } if v.CloseStatusFilter != nil { if err := validateCloseStatusFilter(v.CloseStatusFilter); err != nil { invalidParams.AddNested("CloseStatusFilter", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCountOpenWorkflowExecutionsInput(v *CountOpenWorkflowExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CountOpenWorkflowExecutionsInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.StartTimeFilter == nil { invalidParams.Add(smithy.NewErrParamRequired("StartTimeFilter")) } else if v.StartTimeFilter != nil { if err := validateExecutionTimeFilter(v.StartTimeFilter); err != nil { invalidParams.AddNested("StartTimeFilter", err.(smithy.InvalidParamsError)) } } if v.TypeFilter != nil { if err := validateWorkflowTypeFilter(v.TypeFilter); err != nil { invalidParams.AddNested("TypeFilter", err.(smithy.InvalidParamsError)) } } if v.TagFilter != nil { if err := validateTagFilter(v.TagFilter); err != nil { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } if v.ExecutionFilter != nil { if err := validateWorkflowExecutionFilter(v.ExecutionFilter); err != nil { invalidParams.AddNested("ExecutionFilter", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCountPendingActivityTasksInput(v *CountPendingActivityTasksInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CountPendingActivityTasksInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.TaskList == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskList")) } else if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCountPendingDecisionTasksInput(v *CountPendingDecisionTasksInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CountPendingDecisionTasksInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.TaskList == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskList")) } else if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeprecateActivityTypeInput(v *DeprecateActivityTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeprecateActivityTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.ActivityType == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityType")) } else if v.ActivityType != nil { if err := validateActivityType(v.ActivityType); err != nil { invalidParams.AddNested("ActivityType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeprecateDomainInput(v *DeprecateDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeprecateDomainInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeprecateWorkflowTypeInput(v *DeprecateWorkflowTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeprecateWorkflowTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowType == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowType")) } else if v.WorkflowType != nil { if err := validateWorkflowType(v.WorkflowType); err != nil { invalidParams.AddNested("WorkflowType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeActivityTypeInput(v *DescribeActivityTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeActivityTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.ActivityType == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityType")) } else if v.ActivityType != nil { if err := validateActivityType(v.ActivityType); err != nil { invalidParams.AddNested("ActivityType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainInput(v *DescribeDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorkflowExecutionInput(v *DescribeWorkflowExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorkflowExecutionInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.Execution == nil { invalidParams.Add(smithy.NewErrParamRequired("Execution")) } else if v.Execution != nil { if err := validateWorkflowExecution(v.Execution); err != nil { invalidParams.AddNested("Execution", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorkflowTypeInput(v *DescribeWorkflowTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorkflowTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowType == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowType")) } else if v.WorkflowType != nil { if err := validateWorkflowType(v.WorkflowType); err != nil { invalidParams.AddNested("WorkflowType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetWorkflowExecutionHistoryInput(v *GetWorkflowExecutionHistoryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetWorkflowExecutionHistoryInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.Execution == nil { invalidParams.Add(smithy.NewErrParamRequired("Execution")) } else if v.Execution != nil { if err := validateWorkflowExecution(v.Execution); err != nil { invalidParams.AddNested("Execution", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListActivityTypesInput(v *ListActivityTypesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListActivityTypesInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if len(v.RegistrationStatus) == 0 { invalidParams.Add(smithy.NewErrParamRequired("RegistrationStatus")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListClosedWorkflowExecutionsInput(v *ListClosedWorkflowExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListClosedWorkflowExecutionsInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.StartTimeFilter != nil { if err := validateExecutionTimeFilter(v.StartTimeFilter); err != nil { invalidParams.AddNested("StartTimeFilter", err.(smithy.InvalidParamsError)) } } if v.CloseTimeFilter != nil { if err := validateExecutionTimeFilter(v.CloseTimeFilter); err != nil { invalidParams.AddNested("CloseTimeFilter", err.(smithy.InvalidParamsError)) } } if v.ExecutionFilter != nil { if err := validateWorkflowExecutionFilter(v.ExecutionFilter); err != nil { invalidParams.AddNested("ExecutionFilter", err.(smithy.InvalidParamsError)) } } if v.CloseStatusFilter != nil { if err := validateCloseStatusFilter(v.CloseStatusFilter); err != nil { invalidParams.AddNested("CloseStatusFilter", err.(smithy.InvalidParamsError)) } } if v.TypeFilter != nil { if err := validateWorkflowTypeFilter(v.TypeFilter); err != nil { invalidParams.AddNested("TypeFilter", err.(smithy.InvalidParamsError)) } } if v.TagFilter != nil { if err := validateTagFilter(v.TagFilter); err != nil { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDomainsInput(v *ListDomainsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDomainsInput"} if len(v.RegistrationStatus) == 0 { invalidParams.Add(smithy.NewErrParamRequired("RegistrationStatus")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListOpenWorkflowExecutionsInput(v *ListOpenWorkflowExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOpenWorkflowExecutionsInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.StartTimeFilter == nil { invalidParams.Add(smithy.NewErrParamRequired("StartTimeFilter")) } else if v.StartTimeFilter != nil { if err := validateExecutionTimeFilter(v.StartTimeFilter); err != nil { invalidParams.AddNested("StartTimeFilter", err.(smithy.InvalidParamsError)) } } if v.TypeFilter != nil { if err := validateWorkflowTypeFilter(v.TypeFilter); err != nil { invalidParams.AddNested("TypeFilter", err.(smithy.InvalidParamsError)) } } if v.TagFilter != nil { if err := validateTagFilter(v.TagFilter); err != nil { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } if v.ExecutionFilter != nil { if err := validateWorkflowExecutionFilter(v.ExecutionFilter); err != nil { invalidParams.AddNested("ExecutionFilter", 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 validateOpListWorkflowTypesInput(v *ListWorkflowTypesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListWorkflowTypesInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if len(v.RegistrationStatus) == 0 { invalidParams.Add(smithy.NewErrParamRequired("RegistrationStatus")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPollForActivityTaskInput(v *PollForActivityTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PollForActivityTaskInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.TaskList == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskList")) } else if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPollForDecisionTaskInput(v *PollForDecisionTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PollForDecisionTaskInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.TaskList == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskList")) } else if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRecordActivityTaskHeartbeatInput(v *RecordActivityTaskHeartbeatInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RecordActivityTaskHeartbeatInput"} if v.TaskToken == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRegisterActivityTypeInput(v *RegisterActivityTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterActivityTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Version == nil { invalidParams.Add(smithy.NewErrParamRequired("Version")) } if v.DefaultTaskList != nil { if err := validateTaskList(v.DefaultTaskList); err != nil { invalidParams.AddNested("DefaultTaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRegisterDomainInput(v *RegisterDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterDomainInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.WorkflowExecutionRetentionPeriodInDays == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowExecutionRetentionPeriodInDays")) } if v.Tags != nil { if err := validateResourceTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRegisterWorkflowTypeInput(v *RegisterWorkflowTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterWorkflowTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Version == nil { invalidParams.Add(smithy.NewErrParamRequired("Version")) } if v.DefaultTaskList != nil { if err := validateTaskList(v.DefaultTaskList); err != nil { invalidParams.AddNested("DefaultTaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRequestCancelWorkflowExecutionInput(v *RequestCancelWorkflowExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RequestCancelWorkflowExecutionInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRespondActivityTaskCanceledInput(v *RespondActivityTaskCanceledInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RespondActivityTaskCanceledInput"} if v.TaskToken == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRespondActivityTaskCompletedInput(v *RespondActivityTaskCompletedInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RespondActivityTaskCompletedInput"} if v.TaskToken == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRespondActivityTaskFailedInput(v *RespondActivityTaskFailedInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RespondActivityTaskFailedInput"} if v.TaskToken == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskToken")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRespondDecisionTaskCompletedInput(v *RespondDecisionTaskCompletedInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RespondDecisionTaskCompletedInput"} if v.TaskToken == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskToken")) } if v.Decisions != nil { if err := validateDecisionList(v.Decisions); err != nil { invalidParams.AddNested("Decisions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSignalWorkflowExecutionInput(v *SignalWorkflowExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SignalWorkflowExecutionInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.SignalName == nil { invalidParams.Add(smithy.NewErrParamRequired("SignalName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartWorkflowExecutionInput(v *StartWorkflowExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartWorkflowExecutionInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if v.WorkflowType == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowType")) } else if v.WorkflowType != nil { if err := validateWorkflowType(v.WorkflowType); err != nil { invalidParams.AddNested("WorkflowType", err.(smithy.InvalidParamsError)) } } if v.TaskList != nil { if err := validateTaskList(v.TaskList); err != nil { invalidParams.AddNested("TaskList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateResourceTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTerminateWorkflowExecutionInput(v *TerminateWorkflowExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TerminateWorkflowExecutionInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUndeprecateActivityTypeInput(v *UndeprecateActivityTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UndeprecateActivityTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.ActivityType == nil { invalidParams.Add(smithy.NewErrParamRequired("ActivityType")) } else if v.ActivityType != nil { if err := validateActivityType(v.ActivityType); err != nil { invalidParams.AddNested("ActivityType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUndeprecateDomainInput(v *UndeprecateDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UndeprecateDomainInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUndeprecateWorkflowTypeInput(v *UndeprecateWorkflowTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UndeprecateWorkflowTypeInput"} if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.WorkflowType == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkflowType")) } else if v.WorkflowType != nil { if err := validateWorkflowType(v.WorkflowType); err != nil { invalidParams.AddNested("WorkflowType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,164
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 SWF 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: "swf.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "swf-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "swf-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: "swf-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: "swf-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: "swf-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: "swf-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "swf.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "swf-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{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: "swf-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{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{}, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{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: "swf-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{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: "swf.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "swf-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "swf-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "swf.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{ Hostname: "swf.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, }, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "swf.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, }, endpoints.EndpointKey{ Region: "us-gov-east-1-fips", }: endpoints.Endpoint{ Hostname: "swf.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{ Hostname: "swf.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "swf.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "us-gov-west-1-fips", }: endpoints.Endpoint{ Hostname: "swf.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, }, }, }
515
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 ActivityTaskTimeoutType string // Enum values for ActivityTaskTimeoutType const ( ActivityTaskTimeoutTypeStartToClose ActivityTaskTimeoutType = "START_TO_CLOSE" ActivityTaskTimeoutTypeScheduleToStart ActivityTaskTimeoutType = "SCHEDULE_TO_START" ActivityTaskTimeoutTypeScheduleToClose ActivityTaskTimeoutType = "SCHEDULE_TO_CLOSE" ActivityTaskTimeoutTypeHeartbeat ActivityTaskTimeoutType = "HEARTBEAT" ) // Values returns all known values for ActivityTaskTimeoutType. 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 (ActivityTaskTimeoutType) Values() []ActivityTaskTimeoutType { return []ActivityTaskTimeoutType{ "START_TO_CLOSE", "SCHEDULE_TO_START", "SCHEDULE_TO_CLOSE", "HEARTBEAT", } } type CancelTimerFailedCause string // Enum values for CancelTimerFailedCause const ( CancelTimerFailedCauseTimerIdUnknown CancelTimerFailedCause = "TIMER_ID_UNKNOWN" CancelTimerFailedCauseOperationNotPermitted CancelTimerFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for CancelTimerFailedCause. 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 (CancelTimerFailedCause) Values() []CancelTimerFailedCause { return []CancelTimerFailedCause{ "TIMER_ID_UNKNOWN", "OPERATION_NOT_PERMITTED", } } type CancelWorkflowExecutionFailedCause string // Enum values for CancelWorkflowExecutionFailedCause const ( CancelWorkflowExecutionFailedCauseUnhandledDecision CancelWorkflowExecutionFailedCause = "UNHANDLED_DECISION" CancelWorkflowExecutionFailedCauseOperationNotPermitted CancelWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for CancelWorkflowExecutionFailedCause. 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 (CancelWorkflowExecutionFailedCause) Values() []CancelWorkflowExecutionFailedCause { return []CancelWorkflowExecutionFailedCause{ "UNHANDLED_DECISION", "OPERATION_NOT_PERMITTED", } } type ChildPolicy string // Enum values for ChildPolicy const ( ChildPolicyTerminate ChildPolicy = "TERMINATE" ChildPolicyRequestCancel ChildPolicy = "REQUEST_CANCEL" ChildPolicyAbandon ChildPolicy = "ABANDON" ) // Values returns all known values for ChildPolicy. 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 (ChildPolicy) Values() []ChildPolicy { return []ChildPolicy{ "TERMINATE", "REQUEST_CANCEL", "ABANDON", } } type CloseStatus string // Enum values for CloseStatus const ( CloseStatusCompleted CloseStatus = "COMPLETED" CloseStatusFailed CloseStatus = "FAILED" CloseStatusCanceled CloseStatus = "CANCELED" CloseStatusTerminated CloseStatus = "TERMINATED" CloseStatusContinuedAsNew CloseStatus = "CONTINUED_AS_NEW" CloseStatusTimedOut CloseStatus = "TIMED_OUT" ) // Values returns all known values for CloseStatus. 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 (CloseStatus) Values() []CloseStatus { return []CloseStatus{ "COMPLETED", "FAILED", "CANCELED", "TERMINATED", "CONTINUED_AS_NEW", "TIMED_OUT", } } type CompleteWorkflowExecutionFailedCause string // Enum values for CompleteWorkflowExecutionFailedCause const ( CompleteWorkflowExecutionFailedCauseUnhandledDecision CompleteWorkflowExecutionFailedCause = "UNHANDLED_DECISION" CompleteWorkflowExecutionFailedCauseOperationNotPermitted CompleteWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for CompleteWorkflowExecutionFailedCause. 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 (CompleteWorkflowExecutionFailedCause) Values() []CompleteWorkflowExecutionFailedCause { return []CompleteWorkflowExecutionFailedCause{ "UNHANDLED_DECISION", "OPERATION_NOT_PERMITTED", } } type ContinueAsNewWorkflowExecutionFailedCause string // Enum values for ContinueAsNewWorkflowExecutionFailedCause const ( ContinueAsNewWorkflowExecutionFailedCauseUnhandledDecision ContinueAsNewWorkflowExecutionFailedCause = "UNHANDLED_DECISION" ContinueAsNewWorkflowExecutionFailedCauseWorkflowTypeDeprecated ContinueAsNewWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DEPRECATED" ContinueAsNewWorkflowExecutionFailedCauseWorkflowTypeDoesNotExist ContinueAsNewWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DOES_NOT_EXIST" ContinueAsNewWorkflowExecutionFailedCauseDefaultExecutionStartToCloseTimeoutUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED" ContinueAsNewWorkflowExecutionFailedCauseDefaultTaskStartToCloseTimeoutUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED" ContinueAsNewWorkflowExecutionFailedCauseDefaultTaskListUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" ContinueAsNewWorkflowExecutionFailedCauseDefaultChildPolicyUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_CHILD_POLICY_UNDEFINED" ContinueAsNewWorkflowExecutionFailedCauseContinueAsNewWorkflowExecutionRateExceeded ContinueAsNewWorkflowExecutionFailedCause = "CONTINUE_AS_NEW_WORKFLOW_EXECUTION_RATE_EXCEEDED" ContinueAsNewWorkflowExecutionFailedCauseOperationNotPermitted ContinueAsNewWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for ContinueAsNewWorkflowExecutionFailedCause. // 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 (ContinueAsNewWorkflowExecutionFailedCause) Values() []ContinueAsNewWorkflowExecutionFailedCause { return []ContinueAsNewWorkflowExecutionFailedCause{ "UNHANDLED_DECISION", "WORKFLOW_TYPE_DEPRECATED", "WORKFLOW_TYPE_DOES_NOT_EXIST", "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_TASK_LIST_UNDEFINED", "DEFAULT_CHILD_POLICY_UNDEFINED", "CONTINUE_AS_NEW_WORKFLOW_EXECUTION_RATE_EXCEEDED", "OPERATION_NOT_PERMITTED", } } type DecisionTaskTimeoutType string // Enum values for DecisionTaskTimeoutType const ( DecisionTaskTimeoutTypeStartToClose DecisionTaskTimeoutType = "START_TO_CLOSE" ) // Values returns all known values for DecisionTaskTimeoutType. 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 (DecisionTaskTimeoutType) Values() []DecisionTaskTimeoutType { return []DecisionTaskTimeoutType{ "START_TO_CLOSE", } } type DecisionType string // Enum values for DecisionType const ( DecisionTypeScheduleActivityTask DecisionType = "ScheduleActivityTask" DecisionTypeRequestCancelActivityTask DecisionType = "RequestCancelActivityTask" DecisionTypeCompleteWorkflowExecution DecisionType = "CompleteWorkflowExecution" DecisionTypeFailWorkflowExecution DecisionType = "FailWorkflowExecution" DecisionTypeCancelWorkflowExecution DecisionType = "CancelWorkflowExecution" DecisionTypeContinueAsNewWorkflowExecution DecisionType = "ContinueAsNewWorkflowExecution" DecisionTypeRecordMarker DecisionType = "RecordMarker" DecisionTypeStartTimer DecisionType = "StartTimer" DecisionTypeCancelTimer DecisionType = "CancelTimer" DecisionTypeSignalExternalWorkflowExecution DecisionType = "SignalExternalWorkflowExecution" DecisionTypeRequestCancelExternalWorkflowExecution DecisionType = "RequestCancelExternalWorkflowExecution" DecisionTypeStartChildWorkflowExecution DecisionType = "StartChildWorkflowExecution" DecisionTypeScheduleLambdaFunction DecisionType = "ScheduleLambdaFunction" ) // Values returns all known values for DecisionType. 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 (DecisionType) Values() []DecisionType { return []DecisionType{ "ScheduleActivityTask", "RequestCancelActivityTask", "CompleteWorkflowExecution", "FailWorkflowExecution", "CancelWorkflowExecution", "ContinueAsNewWorkflowExecution", "RecordMarker", "StartTimer", "CancelTimer", "SignalExternalWorkflowExecution", "RequestCancelExternalWorkflowExecution", "StartChildWorkflowExecution", "ScheduleLambdaFunction", } } type EventType string // Enum values for EventType const ( EventTypeWorkflowExecutionStarted EventType = "WorkflowExecutionStarted" EventTypeWorkflowExecutionCancelRequested EventType = "WorkflowExecutionCancelRequested" EventTypeWorkflowExecutionCompleted EventType = "WorkflowExecutionCompleted" EventTypeCompleteWorkflowExecutionFailed EventType = "CompleteWorkflowExecutionFailed" EventTypeWorkflowExecutionFailed EventType = "WorkflowExecutionFailed" EventTypeFailWorkflowExecutionFailed EventType = "FailWorkflowExecutionFailed" EventTypeWorkflowExecutionTimedOut EventType = "WorkflowExecutionTimedOut" EventTypeWorkflowExecutionCanceled EventType = "WorkflowExecutionCanceled" EventTypeCancelWorkflowExecutionFailed EventType = "CancelWorkflowExecutionFailed" EventTypeWorkflowExecutionContinuedAsNew EventType = "WorkflowExecutionContinuedAsNew" EventTypeContinueAsNewWorkflowExecutionFailed EventType = "ContinueAsNewWorkflowExecutionFailed" EventTypeWorkflowExecutionTerminated EventType = "WorkflowExecutionTerminated" EventTypeDecisionTaskScheduled EventType = "DecisionTaskScheduled" EventTypeDecisionTaskStarted EventType = "DecisionTaskStarted" EventTypeDecisionTaskCompleted EventType = "DecisionTaskCompleted" EventTypeDecisionTaskTimedOut EventType = "DecisionTaskTimedOut" EventTypeActivityTaskScheduled EventType = "ActivityTaskScheduled" EventTypeScheduleActivityTaskFailed EventType = "ScheduleActivityTaskFailed" EventTypeActivityTaskStarted EventType = "ActivityTaskStarted" EventTypeActivityTaskCompleted EventType = "ActivityTaskCompleted" EventTypeActivityTaskFailed EventType = "ActivityTaskFailed" EventTypeActivityTaskTimedOut EventType = "ActivityTaskTimedOut" EventTypeActivityTaskCanceled EventType = "ActivityTaskCanceled" EventTypeActivityTaskCancelRequested EventType = "ActivityTaskCancelRequested" EventTypeRequestCancelActivityTaskFailed EventType = "RequestCancelActivityTaskFailed" EventTypeWorkflowExecutionSignaled EventType = "WorkflowExecutionSignaled" EventTypeMarkerRecorded EventType = "MarkerRecorded" EventTypeRecordMarkerFailed EventType = "RecordMarkerFailed" EventTypeTimerStarted EventType = "TimerStarted" EventTypeStartTimerFailed EventType = "StartTimerFailed" EventTypeTimerFired EventType = "TimerFired" EventTypeTimerCanceled EventType = "TimerCanceled" EventTypeCancelTimerFailed EventType = "CancelTimerFailed" EventTypeStartChildWorkflowExecutionInitiated EventType = "StartChildWorkflowExecutionInitiated" EventTypeStartChildWorkflowExecutionFailed EventType = "StartChildWorkflowExecutionFailed" EventTypeChildWorkflowExecutionStarted EventType = "ChildWorkflowExecutionStarted" EventTypeChildWorkflowExecutionCompleted EventType = "ChildWorkflowExecutionCompleted" EventTypeChildWorkflowExecutionFailed EventType = "ChildWorkflowExecutionFailed" EventTypeChildWorkflowExecutionTimedOut EventType = "ChildWorkflowExecutionTimedOut" EventTypeChildWorkflowExecutionCanceled EventType = "ChildWorkflowExecutionCanceled" EventTypeChildWorkflowExecutionTerminated EventType = "ChildWorkflowExecutionTerminated" EventTypeSignalExternalWorkflowExecutionInitiated EventType = "SignalExternalWorkflowExecutionInitiated" EventTypeSignalExternalWorkflowExecutionFailed EventType = "SignalExternalWorkflowExecutionFailed" EventTypeExternalWorkflowExecutionSignaled EventType = "ExternalWorkflowExecutionSignaled" EventTypeRequestCancelExternalWorkflowExecutionInitiated EventType = "RequestCancelExternalWorkflowExecutionInitiated" EventTypeRequestCancelExternalWorkflowExecutionFailed EventType = "RequestCancelExternalWorkflowExecutionFailed" EventTypeExternalWorkflowExecutionCancelRequested EventType = "ExternalWorkflowExecutionCancelRequested" EventTypeLambdaFunctionScheduled EventType = "LambdaFunctionScheduled" EventTypeLambdaFunctionStarted EventType = "LambdaFunctionStarted" EventTypeLambdaFunctionCompleted EventType = "LambdaFunctionCompleted" EventTypeLambdaFunctionFailed EventType = "LambdaFunctionFailed" EventTypeLambdaFunctionTimedOut EventType = "LambdaFunctionTimedOut" EventTypeScheduleLambdaFunctionFailed EventType = "ScheduleLambdaFunctionFailed" EventTypeStartLambdaFunctionFailed EventType = "StartLambdaFunctionFailed" ) // Values returns all known values for EventType. 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 (EventType) Values() []EventType { return []EventType{ "WorkflowExecutionStarted", "WorkflowExecutionCancelRequested", "WorkflowExecutionCompleted", "CompleteWorkflowExecutionFailed", "WorkflowExecutionFailed", "FailWorkflowExecutionFailed", "WorkflowExecutionTimedOut", "WorkflowExecutionCanceled", "CancelWorkflowExecutionFailed", "WorkflowExecutionContinuedAsNew", "ContinueAsNewWorkflowExecutionFailed", "WorkflowExecutionTerminated", "DecisionTaskScheduled", "DecisionTaskStarted", "DecisionTaskCompleted", "DecisionTaskTimedOut", "ActivityTaskScheduled", "ScheduleActivityTaskFailed", "ActivityTaskStarted", "ActivityTaskCompleted", "ActivityTaskFailed", "ActivityTaskTimedOut", "ActivityTaskCanceled", "ActivityTaskCancelRequested", "RequestCancelActivityTaskFailed", "WorkflowExecutionSignaled", "MarkerRecorded", "RecordMarkerFailed", "TimerStarted", "StartTimerFailed", "TimerFired", "TimerCanceled", "CancelTimerFailed", "StartChildWorkflowExecutionInitiated", "StartChildWorkflowExecutionFailed", "ChildWorkflowExecutionStarted", "ChildWorkflowExecutionCompleted", "ChildWorkflowExecutionFailed", "ChildWorkflowExecutionTimedOut", "ChildWorkflowExecutionCanceled", "ChildWorkflowExecutionTerminated", "SignalExternalWorkflowExecutionInitiated", "SignalExternalWorkflowExecutionFailed", "ExternalWorkflowExecutionSignaled", "RequestCancelExternalWorkflowExecutionInitiated", "RequestCancelExternalWorkflowExecutionFailed", "ExternalWorkflowExecutionCancelRequested", "LambdaFunctionScheduled", "LambdaFunctionStarted", "LambdaFunctionCompleted", "LambdaFunctionFailed", "LambdaFunctionTimedOut", "ScheduleLambdaFunctionFailed", "StartLambdaFunctionFailed", } } type ExecutionStatus string // Enum values for ExecutionStatus const ( ExecutionStatusOpen ExecutionStatus = "OPEN" ExecutionStatusClosed ExecutionStatus = "CLOSED" ) // 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{ "OPEN", "CLOSED", } } type FailWorkflowExecutionFailedCause string // Enum values for FailWorkflowExecutionFailedCause const ( FailWorkflowExecutionFailedCauseUnhandledDecision FailWorkflowExecutionFailedCause = "UNHANDLED_DECISION" FailWorkflowExecutionFailedCauseOperationNotPermitted FailWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for FailWorkflowExecutionFailedCause. 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 (FailWorkflowExecutionFailedCause) Values() []FailWorkflowExecutionFailedCause { return []FailWorkflowExecutionFailedCause{ "UNHANDLED_DECISION", "OPERATION_NOT_PERMITTED", } } type LambdaFunctionTimeoutType string // Enum values for LambdaFunctionTimeoutType const ( LambdaFunctionTimeoutTypeStartToClose LambdaFunctionTimeoutType = "START_TO_CLOSE" ) // Values returns all known values for LambdaFunctionTimeoutType. 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 (LambdaFunctionTimeoutType) Values() []LambdaFunctionTimeoutType { return []LambdaFunctionTimeoutType{ "START_TO_CLOSE", } } type RecordMarkerFailedCause string // Enum values for RecordMarkerFailedCause const ( RecordMarkerFailedCauseOperationNotPermitted RecordMarkerFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for RecordMarkerFailedCause. 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 (RecordMarkerFailedCause) Values() []RecordMarkerFailedCause { return []RecordMarkerFailedCause{ "OPERATION_NOT_PERMITTED", } } type RegistrationStatus string // Enum values for RegistrationStatus const ( RegistrationStatusRegistered RegistrationStatus = "REGISTERED" RegistrationStatusDeprecated RegistrationStatus = "DEPRECATED" ) // Values returns all known values for RegistrationStatus. 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 (RegistrationStatus) Values() []RegistrationStatus { return []RegistrationStatus{ "REGISTERED", "DEPRECATED", } } type RequestCancelActivityTaskFailedCause string // Enum values for RequestCancelActivityTaskFailedCause const ( RequestCancelActivityTaskFailedCauseActivityIdUnknown RequestCancelActivityTaskFailedCause = "ACTIVITY_ID_UNKNOWN" RequestCancelActivityTaskFailedCauseOperationNotPermitted RequestCancelActivityTaskFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for RequestCancelActivityTaskFailedCause. 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 (RequestCancelActivityTaskFailedCause) Values() []RequestCancelActivityTaskFailedCause { return []RequestCancelActivityTaskFailedCause{ "ACTIVITY_ID_UNKNOWN", "OPERATION_NOT_PERMITTED", } } type RequestCancelExternalWorkflowExecutionFailedCause string // Enum values for RequestCancelExternalWorkflowExecutionFailedCause const ( RequestCancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution RequestCancelExternalWorkflowExecutionFailedCause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION" RequestCancelExternalWorkflowExecutionFailedCauseRequestCancelExternalWorkflowExecutionRateExceeded RequestCancelExternalWorkflowExecutionFailedCause = "REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED" RequestCancelExternalWorkflowExecutionFailedCauseOperationNotPermitted RequestCancelExternalWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for // RequestCancelExternalWorkflowExecutionFailedCause. 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 (RequestCancelExternalWorkflowExecutionFailedCause) Values() []RequestCancelExternalWorkflowExecutionFailedCause { return []RequestCancelExternalWorkflowExecutionFailedCause{ "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION", "REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED", "OPERATION_NOT_PERMITTED", } } type ScheduleActivityTaskFailedCause string // Enum values for ScheduleActivityTaskFailedCause const ( ScheduleActivityTaskFailedCauseActivityTypeDeprecated ScheduleActivityTaskFailedCause = "ACTIVITY_TYPE_DEPRECATED" ScheduleActivityTaskFailedCauseActivityTypeDoesNotExist ScheduleActivityTaskFailedCause = "ACTIVITY_TYPE_DOES_NOT_EXIST" ScheduleActivityTaskFailedCauseActivityIdAlreadyInUse ScheduleActivityTaskFailedCause = "ACTIVITY_ID_ALREADY_IN_USE" ScheduleActivityTaskFailedCauseOpenActivitiesLimitExceeded ScheduleActivityTaskFailedCause = "OPEN_ACTIVITIES_LIMIT_EXCEEDED" ScheduleActivityTaskFailedCauseActivityCreationRateExceeded ScheduleActivityTaskFailedCause = "ACTIVITY_CREATION_RATE_EXCEEDED" ScheduleActivityTaskFailedCauseDefaultScheduleToCloseTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_SCHEDULE_TO_CLOSE_TIMEOUT_UNDEFINED" ScheduleActivityTaskFailedCauseDefaultTaskListUndefined ScheduleActivityTaskFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" ScheduleActivityTaskFailedCauseDefaultScheduleToStartTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_SCHEDULE_TO_START_TIMEOUT_UNDEFINED" ScheduleActivityTaskFailedCauseDefaultStartToCloseTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_START_TO_CLOSE_TIMEOUT_UNDEFINED" ScheduleActivityTaskFailedCauseDefaultHeartbeatTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_HEARTBEAT_TIMEOUT_UNDEFINED" ScheduleActivityTaskFailedCauseOperationNotPermitted ScheduleActivityTaskFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for ScheduleActivityTaskFailedCause. 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 (ScheduleActivityTaskFailedCause) Values() []ScheduleActivityTaskFailedCause { return []ScheduleActivityTaskFailedCause{ "ACTIVITY_TYPE_DEPRECATED", "ACTIVITY_TYPE_DOES_NOT_EXIST", "ACTIVITY_ID_ALREADY_IN_USE", "OPEN_ACTIVITIES_LIMIT_EXCEEDED", "ACTIVITY_CREATION_RATE_EXCEEDED", "DEFAULT_SCHEDULE_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_TASK_LIST_UNDEFINED", "DEFAULT_SCHEDULE_TO_START_TIMEOUT_UNDEFINED", "DEFAULT_START_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_HEARTBEAT_TIMEOUT_UNDEFINED", "OPERATION_NOT_PERMITTED", } } type ScheduleLambdaFunctionFailedCause string // Enum values for ScheduleLambdaFunctionFailedCause const ( ScheduleLambdaFunctionFailedCauseIdAlreadyInUse ScheduleLambdaFunctionFailedCause = "ID_ALREADY_IN_USE" ScheduleLambdaFunctionFailedCauseOpenLambdaFunctionsLimitExceeded ScheduleLambdaFunctionFailedCause = "OPEN_LAMBDA_FUNCTIONS_LIMIT_EXCEEDED" ScheduleLambdaFunctionFailedCauseLambdaFunctionCreationRateExceeded ScheduleLambdaFunctionFailedCause = "LAMBDA_FUNCTION_CREATION_RATE_EXCEEDED" ScheduleLambdaFunctionFailedCauseLambdaServiceNotAvailableInRegion ScheduleLambdaFunctionFailedCause = "LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION" ) // Values returns all known values for ScheduleLambdaFunctionFailedCause. 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 (ScheduleLambdaFunctionFailedCause) Values() []ScheduleLambdaFunctionFailedCause { return []ScheduleLambdaFunctionFailedCause{ "ID_ALREADY_IN_USE", "OPEN_LAMBDA_FUNCTIONS_LIMIT_EXCEEDED", "LAMBDA_FUNCTION_CREATION_RATE_EXCEEDED", "LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION", } } type SignalExternalWorkflowExecutionFailedCause string // Enum values for SignalExternalWorkflowExecutionFailedCause const ( SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution SignalExternalWorkflowExecutionFailedCause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION" SignalExternalWorkflowExecutionFailedCauseSignalExternalWorkflowExecutionRateExceeded SignalExternalWorkflowExecutionFailedCause = "SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED" SignalExternalWorkflowExecutionFailedCauseOperationNotPermitted SignalExternalWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for SignalExternalWorkflowExecutionFailedCause. // 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 (SignalExternalWorkflowExecutionFailedCause) Values() []SignalExternalWorkflowExecutionFailedCause { return []SignalExternalWorkflowExecutionFailedCause{ "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION", "SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED", "OPERATION_NOT_PERMITTED", } } type StartChildWorkflowExecutionFailedCause string // Enum values for StartChildWorkflowExecutionFailedCause const ( StartChildWorkflowExecutionFailedCauseWorkflowTypeDoesNotExist StartChildWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DOES_NOT_EXIST" StartChildWorkflowExecutionFailedCauseWorkflowTypeDeprecated StartChildWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DEPRECATED" StartChildWorkflowExecutionFailedCauseOpenChildrenLimitExceeded StartChildWorkflowExecutionFailedCause = "OPEN_CHILDREN_LIMIT_EXCEEDED" StartChildWorkflowExecutionFailedCauseOpenWorkflowsLimitExceeded StartChildWorkflowExecutionFailedCause = "OPEN_WORKFLOWS_LIMIT_EXCEEDED" StartChildWorkflowExecutionFailedCauseChildCreationRateExceeded StartChildWorkflowExecutionFailedCause = "CHILD_CREATION_RATE_EXCEEDED" StartChildWorkflowExecutionFailedCauseWorkflowAlreadyRunning StartChildWorkflowExecutionFailedCause = "WORKFLOW_ALREADY_RUNNING" StartChildWorkflowExecutionFailedCauseDefaultExecutionStartToCloseTimeoutUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED" StartChildWorkflowExecutionFailedCauseDefaultTaskListUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" StartChildWorkflowExecutionFailedCauseDefaultTaskStartToCloseTimeoutUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED" StartChildWorkflowExecutionFailedCauseDefaultChildPolicyUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_CHILD_POLICY_UNDEFINED" StartChildWorkflowExecutionFailedCauseOperationNotPermitted StartChildWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for StartChildWorkflowExecutionFailedCause. // 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 (StartChildWorkflowExecutionFailedCause) Values() []StartChildWorkflowExecutionFailedCause { return []StartChildWorkflowExecutionFailedCause{ "WORKFLOW_TYPE_DOES_NOT_EXIST", "WORKFLOW_TYPE_DEPRECATED", "OPEN_CHILDREN_LIMIT_EXCEEDED", "OPEN_WORKFLOWS_LIMIT_EXCEEDED", "CHILD_CREATION_RATE_EXCEEDED", "WORKFLOW_ALREADY_RUNNING", "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_TASK_LIST_UNDEFINED", "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED", "DEFAULT_CHILD_POLICY_UNDEFINED", "OPERATION_NOT_PERMITTED", } } type StartLambdaFunctionFailedCause string // Enum values for StartLambdaFunctionFailedCause const ( StartLambdaFunctionFailedCauseAssumeRoleFailed StartLambdaFunctionFailedCause = "ASSUME_ROLE_FAILED" ) // Values returns all known values for StartLambdaFunctionFailedCause. 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 (StartLambdaFunctionFailedCause) Values() []StartLambdaFunctionFailedCause { return []StartLambdaFunctionFailedCause{ "ASSUME_ROLE_FAILED", } } type StartTimerFailedCause string // Enum values for StartTimerFailedCause const ( StartTimerFailedCauseTimerIdAlreadyInUse StartTimerFailedCause = "TIMER_ID_ALREADY_IN_USE" StartTimerFailedCauseOpenTimersLimitExceeded StartTimerFailedCause = "OPEN_TIMERS_LIMIT_EXCEEDED" StartTimerFailedCauseTimerCreationRateExceeded StartTimerFailedCause = "TIMER_CREATION_RATE_EXCEEDED" StartTimerFailedCauseOperationNotPermitted StartTimerFailedCause = "OPERATION_NOT_PERMITTED" ) // Values returns all known values for StartTimerFailedCause. 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 (StartTimerFailedCause) Values() []StartTimerFailedCause { return []StartTimerFailedCause{ "TIMER_ID_ALREADY_IN_USE", "OPEN_TIMERS_LIMIT_EXCEEDED", "TIMER_CREATION_RATE_EXCEEDED", "OPERATION_NOT_PERMITTED", } } type WorkflowExecutionCancelRequestedCause string // Enum values for WorkflowExecutionCancelRequestedCause const ( WorkflowExecutionCancelRequestedCauseChildPolicyApplied WorkflowExecutionCancelRequestedCause = "CHILD_POLICY_APPLIED" ) // Values returns all known values for WorkflowExecutionCancelRequestedCause. 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 (WorkflowExecutionCancelRequestedCause) Values() []WorkflowExecutionCancelRequestedCause { return []WorkflowExecutionCancelRequestedCause{ "CHILD_POLICY_APPLIED", } } type WorkflowExecutionTerminatedCause string // Enum values for WorkflowExecutionTerminatedCause const ( WorkflowExecutionTerminatedCauseChildPolicyApplied WorkflowExecutionTerminatedCause = "CHILD_POLICY_APPLIED" WorkflowExecutionTerminatedCauseEventLimitExceeded WorkflowExecutionTerminatedCause = "EVENT_LIMIT_EXCEEDED" WorkflowExecutionTerminatedCauseOperatorInitiated WorkflowExecutionTerminatedCause = "OPERATOR_INITIATED" ) // Values returns all known values for WorkflowExecutionTerminatedCause. 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 (WorkflowExecutionTerminatedCause) Values() []WorkflowExecutionTerminatedCause { return []WorkflowExecutionTerminatedCause{ "CHILD_POLICY_APPLIED", "EVENT_LIMIT_EXCEEDED", "OPERATOR_INITIATED", } } type WorkflowExecutionTimeoutType string // Enum values for WorkflowExecutionTimeoutType const ( WorkflowExecutionTimeoutTypeStartToClose WorkflowExecutionTimeoutType = "START_TO_CLOSE" ) // Values returns all known values for WorkflowExecutionTimeoutType. 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 (WorkflowExecutionTimeoutType) Values() []WorkflowExecutionTimeoutType { return []WorkflowExecutionTimeoutType{ "START_TO_CLOSE", } }
678
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // The StartWorkflowExecution API action was called without the required // parameters set. Some workflow execution parameters, such as the decision // taskList , must be set to start the execution. However, these parameters might // have been set as defaults when the workflow type was registered. In this case, // you can omit these parameters from the StartWorkflowExecution call and Amazon // SWF uses the values defined in the workflow type. If these parameters aren't set // and no default parameters were defined in the workflow type, this error is // displayed. type DefaultUndefinedFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DefaultUndefinedFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DefaultUndefinedFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DefaultUndefinedFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DefaultUndefinedFault" } return *e.ErrorCodeOverride } func (e *DefaultUndefinedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned if the domain already exists. You may get this fault if you are // registering a domain that is either already registered or deprecated, or if you // undeprecate a domain that is currently registered. type DomainAlreadyExistsFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DomainAlreadyExistsFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DomainAlreadyExistsFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DomainAlreadyExistsFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DomainAlreadyExistsFault" } return *e.ErrorCodeOverride } func (e *DomainAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned when the specified domain has been deprecated. type DomainDeprecatedFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DomainDeprecatedFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DomainDeprecatedFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DomainDeprecatedFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DomainDeprecatedFault" } return *e.ErrorCodeOverride } func (e *DomainDeprecatedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned by any operation if a system imposed limitation has been reached. To // address this fault you should either clean up unused resources or increase the // limit by contacting AWS. type LimitExceededFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *LimitExceededFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededFault" } return *e.ErrorCodeOverride } func (e *LimitExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned when the caller doesn't have sufficient permissions to invoke the // action. type OperationNotPermittedFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OperationNotPermittedFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OperationNotPermittedFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OperationNotPermittedFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OperationNotPermittedFault" } return *e.ErrorCodeOverride } func (e *OperationNotPermittedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You've exceeded the number of tags allowed for a domain. type TooManyTagsFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyTagsFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyTagsFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyTagsFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyTagsFault" } return *e.ErrorCodeOverride } func (e *TooManyTagsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned if the type already exists in the specified domain. You may get this // fault if you are registering a type that is either already registered or // deprecated, or if you undeprecate a type that is currently registered. type TypeAlreadyExistsFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TypeAlreadyExistsFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TypeAlreadyExistsFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TypeAlreadyExistsFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TypeAlreadyExistsFault" } return *e.ErrorCodeOverride } func (e *TypeAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned when the specified activity or workflow type was already deprecated. type TypeDeprecatedFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TypeDeprecatedFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TypeDeprecatedFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TypeDeprecatedFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TypeDeprecatedFault" } return *e.ErrorCodeOverride } func (e *TypeDeprecatedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was never // created or is no longer available for this operation. type UnknownResourceFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnknownResourceFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnknownResourceFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnknownResourceFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnknownResourceFault" } return *e.ErrorCodeOverride } func (e *UnknownResourceFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returned by StartWorkflowExecution when an open execution with the same // workflowId is already running in the specified domain. type WorkflowExecutionAlreadyStartedFault struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *WorkflowExecutionAlreadyStartedFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *WorkflowExecutionAlreadyStartedFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *WorkflowExecutionAlreadyStartedFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "WorkflowExecutionAlreadyStartedFault" } return *e.ErrorCodeOverride } func (e *WorkflowExecutionAlreadyStartedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
288
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // Provides the details of the ActivityTaskCanceled event. type ActivityTaskCanceledEventAttributes struct { // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the ActivityTaskStarted event recorded when this activity task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // Details of the cancellation. Details *string // If set, contains the ID of the last ActivityTaskCancelRequested event recorded // for this activity task. This information can be useful for diagnosing problems // by tracing back the chain of events leading up to this event. LatestCancelRequestedEventId int64 noSmithyDocumentSerde } // Provides the details of the ActivityTaskCancelRequested event. type ActivityTaskCancelRequestedEventAttributes struct { // The unique ID of the task. // // This member is required. ActivityId *string // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RequestCancelActivityTask decision for this cancellation // request. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Provides the details of the ActivityTaskCompleted event. type ActivityTaskCompletedEventAttributes struct { // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the ActivityTaskStarted event recorded when this activity task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The results of the activity task. Result *string noSmithyDocumentSerde } // Provides the details of the ActivityTaskFailed event. type ActivityTaskFailedEventAttributes struct { // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the ActivityTaskStarted event recorded when this activity task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The details of the failure. Details *string // The reason provided for the failure. Reason *string noSmithyDocumentSerde } // Provides the details of the ActivityTaskScheduled event. type ActivityTaskScheduledEventAttributes struct { // The unique ID of the activity task. // // This member is required. ActivityId *string // The type of the activity task. // // This member is required. ActivityType *ActivityType // The ID of the DecisionTaskCompleted event corresponding to the decision that // resulted in the scheduling of this activity task. This information can be useful // for diagnosing problems by tracing back the chain of events leading up to this // event. // // This member is required. DecisionTaskCompletedEventId int64 // The task list in which the activity task has been scheduled. // // This member is required. TaskList *TaskList // Data attached to the event that can be used by the decider in subsequent // workflow tasks. This data isn't sent to the activity. Control *string // The maximum time before which the worker processing this task must report // progress by calling RecordActivityTaskHeartbeat . If the timeout is exceeded, // the activity task is automatically timed out. If the worker subsequently // attempts to record a heartbeat or return a result, it is ignored. HeartbeatTimeout *string // The input provided to the activity task. Input *string // The maximum amount of time for this activity task. ScheduleToCloseTimeout *string // The maximum amount of time the activity task can wait to be assigned to a // worker. ScheduleToStartTimeout *string // The maximum amount of time a worker may take to process the activity task. StartToCloseTimeout *string // The priority to assign to the scheduled activity task. If set, this overrides // any default priority value that was assigned when the activity type was // registered. Valid values are integers that range from Java's Integer.MIN_VALUE // (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher // priority. For more information about setting task priority, see Setting Task // Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string noSmithyDocumentSerde } // Provides the details of the ActivityTaskStarted event. type ActivityTaskStartedEventAttributes struct { // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // Identity of the worker that was assigned this task. This aids diagnostics when // problems arise. The form of this identity is user defined. Identity *string noSmithyDocumentSerde } // Provides the details of the ActivityTaskTimedOut event. type ActivityTaskTimedOutEventAttributes struct { // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the ActivityTaskStarted event recorded when this activity task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The type of the timeout that caused this event. // // This member is required. TimeoutType ActivityTaskTimeoutType // Contains the content of the details parameter for the last call made by the // activity to RecordActivityTaskHeartbeat . Details *string noSmithyDocumentSerde } // Represents an activity type. type ActivityType struct { // The name of this activity. The combination of activity type name and version // must be unique within a domain. // // This member is required. Name *string // The version of this activity. The combination of activity type name and version // must be unique with in a domain. // // This member is required. Version *string noSmithyDocumentSerde } // Configuration settings registered with the activity type. type ActivityTypeConfiguration struct { // The default maximum time, in seconds, before which a worker processing a task // must report progress by calling RecordActivityTaskHeartbeat . You can specify // this value only when registering an activity type. The registered default value // can be overridden when you schedule a task through the ScheduleActivityTask // Decision . If the activity worker subsequently attempts to record a heartbeat or // returns a result, the activity worker receives an UnknownResource fault. In // this case, Amazon SWF no longer considers the activity task to be valid; the // activity worker should clean up the activity task. The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. DefaultTaskHeartbeatTimeout *string // The default task list specified for this activity type at registration. This // default is used if a task list isn't provided when a task is scheduled through // the ScheduleActivityTask Decision . You can override the default registered task // list when scheduling a task through the ScheduleActivityTask Decision . DefaultTaskList *TaskList // The default task priority for tasks of this activity type, specified at // registration. If not set, then 0 is used as the default priority. This default // can be overridden when scheduling an activity task. Valid values are integers // that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE // (2147483647). Higher numbers indicate higher priority. For more information // about setting task priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. DefaultTaskPriority *string // The default maximum duration, specified when registering the activity type, for // tasks of this activity type. You can override this default when scheduling a // task through the ScheduleActivityTask Decision . The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. DefaultTaskScheduleToCloseTimeout *string // The default maximum duration, specified when registering the activity type, // that a task of an activity type can wait before being assigned to a worker. You // can override this default when scheduling a task through the // ScheduleActivityTask Decision . The duration is specified in seconds, an integer // greater than or equal to 0 . You can use NONE to specify unlimited duration. DefaultTaskScheduleToStartTimeout *string // The default maximum duration for tasks of an activity type specified when // registering the activity type. You can override this default when scheduling a // task through the ScheduleActivityTask Decision . The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. DefaultTaskStartToCloseTimeout *string noSmithyDocumentSerde } // Detailed information about an activity type. type ActivityTypeInfo struct { // The ActivityType type structure representing the activity type. // // This member is required. ActivityType *ActivityType // The date and time this activity type was created through RegisterActivityType . // // This member is required. CreationDate *time.Time // The current status of the activity type. // // This member is required. Status RegistrationStatus // If DEPRECATED, the date and time DeprecateActivityType was called. DeprecationDate *time.Time // The description of the activity type provided in RegisterActivityType . Description *string noSmithyDocumentSerde } // Provides the details of the CancelTimer decision. Access Control You can use // IAM policies to control this decision's access to Amazon SWF resources as // follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type CancelTimerDecisionAttributes struct { // The unique ID of the timer to cancel. // // This member is required. TimerId *string noSmithyDocumentSerde } // Provides the details of the CancelTimerFailed event. type CancelTimerFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause CancelTimerFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CancelTimer decision to cancel this timer. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The timerId provided in the CancelTimer decision that failed. // // This member is required. TimerId *string noSmithyDocumentSerde } // Provides the details of the CancelWorkflowExecution decision. Access Control // You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type CancelWorkflowExecutionDecisionAttributes struct { // Details of the cancellation. Details *string noSmithyDocumentSerde } // Provides the details of the CancelWorkflowExecutionFailed event. type CancelWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause CancelWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CancelWorkflowExecution decision for this cancellation // request. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Provide details of the ChildWorkflowExecutionCanceled event. type ChildWorkflowExecutionCanceledEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The ID of the ChildWorkflowExecutionStarted event recorded when this child // workflow execution was started. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The child workflow execution that was canceled. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType // Details of the cancellation (if provided). Details *string noSmithyDocumentSerde } // Provides the details of the ChildWorkflowExecutionCompleted event. type ChildWorkflowExecutionCompletedEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The ID of the ChildWorkflowExecutionStarted event recorded when this child // workflow execution was started. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The child workflow execution that was completed. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType // The result of the child workflow execution. Result *string noSmithyDocumentSerde } // Provides the details of the ChildWorkflowExecutionFailed event. type ChildWorkflowExecutionFailedEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The ID of the ChildWorkflowExecutionStarted event recorded when this child // workflow execution was started. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The child workflow execution that failed. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType // The details of the failure (if provided). Details *string // The reason for the failure (if provided). Reason *string noSmithyDocumentSerde } // Provides the details of the ChildWorkflowExecutionStarted event. type ChildWorkflowExecutionStartedEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The child workflow execution that was started. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType noSmithyDocumentSerde } // Provides the details of the ChildWorkflowExecutionTerminated event. type ChildWorkflowExecutionTerminatedEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The ID of the ChildWorkflowExecutionStarted event recorded when this child // workflow execution was started. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The child workflow execution that was terminated. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType noSmithyDocumentSerde } // Provides the details of the ChildWorkflowExecutionTimedOut event. type ChildWorkflowExecutionTimedOutEventAttributes struct { // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this child workflow execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. InitiatedEventId int64 // The ID of the ChildWorkflowExecutionStarted event recorded when this child // workflow execution was started. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The type of the timeout that caused the child workflow execution to time out. // // This member is required. TimeoutType WorkflowExecutionTimeoutType // The child workflow execution that timed out. // // This member is required. WorkflowExecution *WorkflowExecution // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType noSmithyDocumentSerde } // Used to filter the closed workflow executions in visibility APIs by their close // status. type CloseStatusFilter struct { // The close status that must match the close status of an execution for it to // meet the criteria of this filter. // // This member is required. Status CloseStatus noSmithyDocumentSerde } // Provides the details of the CompleteWorkflowExecution decision. Access Control // You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type CompleteWorkflowExecutionDecisionAttributes struct { // The result of the workflow execution. The form of the result is implementation // defined. Result *string noSmithyDocumentSerde } // Provides the details of the CompleteWorkflowExecutionFailed event. type CompleteWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause CompleteWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CompleteWorkflowExecution decision to complete this // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Provides the details of the ContinueAsNewWorkflowExecution decision. Access // Control You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - tag – A tag used to identify the workflow execution // - taskList – String constraint. The key is swf:taskList.name . // - workflowType.version – String constraint. The key is // swf:workflowType.version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type ContinueAsNewWorkflowExecutionDecisionAttributes struct { // If set, specifies the policy to use for the child workflow executions of the // new execution if it is terminated by calling the TerminateWorkflowExecution // action explicitly or due to an expired timeout. This policy overrides the // default child policy specified when registering the workflow type using // RegisterWorkflowType . The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // A child policy for this workflow execution must be specified either as a // default for the workflow type or through this parameter. If neither this // parameter is set nor a default child policy was specified at registration time // then a fault is returned. ChildPolicy ChildPolicy // If set, specifies the total duration for this workflow execution. This // overrides the defaultExecutionStartToCloseTimeout specified when registering // the workflow type. The duration is specified in seconds, an integer greater than // or equal to 0 . You can use NONE to specify unlimited duration. An execution // start-to-close timeout for this workflow execution must be specified either as a // default for the workflow type or through this field. If neither this field is // set nor a default execution start-to-close timeout was specified at registration // time then a fault is returned. ExecutionStartToCloseTimeout *string // The input provided to the new workflow execution. Input *string // The IAM role to attach to the new (continued) execution. LambdaRole *string // The list of tags to associate with the new workflow execution. A maximum of 5 // tags can be specified. You can list workflow executions with a specific tag by // calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and // specifying a TagFilter . TagList []string // The task list to use for the decisions of the new (continued) workflow // execution. TaskList *TaskList // The task priority that, if set, specifies the priority for the decision tasks // for this workflow execution. This overrides the defaultTaskPriority specified // when registering the workflow type. Valid values are integers that range from // Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). // Higher numbers indicate higher priority. For more information about setting task // priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string // Specifies the maximum duration of decision tasks for the new workflow // execution. This parameter overrides the defaultTaskStartToCloseTimout specified // when registering the workflow type using RegisterWorkflowType . The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. A task start-to-close timeout for the new // workflow execution must be specified either as a default for the workflow type // or through this parameter. If neither this parameter is set nor a default task // start-to-close timeout was specified at registration time then a fault is // returned. TaskStartToCloseTimeout *string // The version of the workflow to start. WorkflowTypeVersion *string noSmithyDocumentSerde } // Provides the details of the ContinueAsNewWorkflowExecutionFailed event. type ContinueAsNewWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause ContinueAsNewWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the ContinueAsNewWorkflowExecution decision that started this // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Specifies a decision made by the decider. A decision can be one of these types: // - CancelTimer – Cancels a previously started timer and records a TimerCanceled // event in the history. // - CancelWorkflowExecution – Closes the workflow execution and records a // WorkflowExecutionCanceled event in the history. // - CompleteWorkflowExecution – Closes the workflow execution and records a // WorkflowExecutionCompleted event in the history . // - ContinueAsNewWorkflowExecution – Closes the workflow execution and starts a // new workflow execution of the same type using the same workflow ID and a unique // run Id. A WorkflowExecutionContinuedAsNew event is recorded in the history. // - FailWorkflowExecution – Closes the workflow execution and records a // WorkflowExecutionFailed event in the history. // - RecordMarker – Records a MarkerRecorded event in the history. Markers can be // used for adding custom information in the history for instance to let deciders // know that they don't need to look at the history beyond the marker event. // - RequestCancelActivityTask – Attempts to cancel a previously scheduled // activity task. If the activity task was scheduled but has not been assigned to a // worker, then it is canceled. If the activity task was already assigned to a // worker, then the worker is informed that cancellation has been requested in the // response to RecordActivityTaskHeartbeat . // - RequestCancelExternalWorkflowExecution – Requests that a request be made to // cancel the specified external workflow execution and records a // RequestCancelExternalWorkflowExecutionInitiated event in the history. // - ScheduleActivityTask – Schedules an activity task. // - SignalExternalWorkflowExecution – Requests a signal to be delivered to the // specified external workflow execution and records a // SignalExternalWorkflowExecutionInitiated event in the history. // - StartChildWorkflowExecution – Requests that a child workflow execution be // started and records a StartChildWorkflowExecutionInitiated event in the // history. The child workflow execution is a separate workflow execution with its // own history. // - StartTimer – Starts a timer for this workflow execution and records a // TimerStarted event in the history. This timer fires after the specified delay // and record a TimerFired event. // // Access Control If you grant permission to use RespondDecisionTaskCompleted , you // can use IAM policies to express permissions for the list of decisions returned // by this action as if they were members of the API. Treating decisions as a // pseudo API maintains a uniform conceptual model and helps keep policies // readable. For details and example IAM policies, see Using IAM to Manage Access // to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. Decision Failure Decisions can fail for // several reasons // - The ordering of decisions should follow a logical flow. Some decisions // might not make sense in the current context of the workflow execution and // therefore fails. // - A limit on your account was reached. // - The decision lacks sufficient permissions. // // One of the following events might be added to the history to indicate an error. // The event attribute's cause parameter indicates the cause. If cause is set to // OPERATION_NOT_PERMITTED , the decision failed because it lacked sufficient // permissions. For details and example IAM policies, see Using IAM to Manage // Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // - ScheduleActivityTaskFailed – A ScheduleActivityTask decision failed. This // could happen if the activity type specified in the decision isn't registered, is // in a deprecated state, or the decision isn't properly configured. // - RequestCancelActivityTaskFailed – A RequestCancelActivityTask decision // failed. This could happen if there is no open activity task with the specified // activityId. // - StartTimerFailed – A StartTimer decision failed. This could happen if there // is another open timer with the same timerId. // - CancelTimerFailed – A CancelTimer decision failed. This could happen if // there is no open timer with the specified timerId. // - StartChildWorkflowExecutionFailed – A StartChildWorkflowExecution decision // failed. This could happen if the workflow type specified isn't registered, is // deprecated, or the decision isn't properly configured. // - SignalExternalWorkflowExecutionFailed – A SignalExternalWorkflowExecution // decision failed. This could happen if the workflowID specified in the decision // was incorrect. // - RequestCancelExternalWorkflowExecutionFailed – A // RequestCancelExternalWorkflowExecution decision failed. This could happen if // the workflowID specified in the decision was incorrect. // - CancelWorkflowExecutionFailed – A CancelWorkflowExecution decision failed. // This could happen if there is an unhandled decision task pending in the workflow // execution. // - CompleteWorkflowExecutionFailed – A CompleteWorkflowExecution decision // failed. This could happen if there is an unhandled decision task pending in the // workflow execution. // - ContinueAsNewWorkflowExecutionFailed – A ContinueAsNewWorkflowExecution // decision failed. This could happen if there is an unhandled decision task // pending in the workflow execution or the ContinueAsNewWorkflowExecution decision // was not configured correctly. // - FailWorkflowExecutionFailed – A FailWorkflowExecution decision failed. This // could happen if there is an unhandled decision task pending in the workflow // execution. // // The preceding error events might occur due to an error in the decider logic, // which might put the workflow execution in an unstable state The cause field in // the event structure for the error event indicates the cause of the error. A // workflow execution may be closed by the decider by returning one of the // following decisions when completing a decision task: CompleteWorkflowExecution , // FailWorkflowExecution , CancelWorkflowExecution and // ContinueAsNewWorkflowExecution . An UnhandledDecision fault is returned if a // workflow closing decision is specified and a signal or activity event had been // added to the history while the decision task was being performed by the decider. // Unlike the above situations which are logic issues, this fault is always // possible because of race conditions in a distributed system. The right action // here is to call RespondDecisionTaskCompleted without any decisions. This would // result in another decision task with these new events included in the history. // The decider should handle the new events and may decide to close the workflow // execution. How to Code a Decision You code a decision by first setting the // decision type field to one of the above decision values, and then set the // corresponding attributes field shown below: // - ScheduleActivityTaskDecisionAttributes // - RequestCancelActivityTaskDecisionAttributes // - CompleteWorkflowExecutionDecisionAttributes // - FailWorkflowExecutionDecisionAttributes // - CancelWorkflowExecutionDecisionAttributes // - ContinueAsNewWorkflowExecutionDecisionAttributes // - RecordMarkerDecisionAttributes // - StartTimerDecisionAttributes // - CancelTimerDecisionAttributes // - SignalExternalWorkflowExecutionDecisionAttributes // - RequestCancelExternalWorkflowExecutionDecisionAttributes // - StartChildWorkflowExecutionDecisionAttributes type Decision struct { // Specifies the type of the decision. // // This member is required. DecisionType DecisionType // Provides the details of the CancelTimer decision. It isn't set for other // decision types. CancelTimerDecisionAttributes *CancelTimerDecisionAttributes // Provides the details of the CancelWorkflowExecution decision. It isn't set for // other decision types. CancelWorkflowExecutionDecisionAttributes *CancelWorkflowExecutionDecisionAttributes // Provides the details of the CompleteWorkflowExecution decision. It isn't set // for other decision types. CompleteWorkflowExecutionDecisionAttributes *CompleteWorkflowExecutionDecisionAttributes // Provides the details of the ContinueAsNewWorkflowExecution decision. It isn't // set for other decision types. ContinueAsNewWorkflowExecutionDecisionAttributes *ContinueAsNewWorkflowExecutionDecisionAttributes // Provides the details of the FailWorkflowExecution decision. It isn't set for // other decision types. FailWorkflowExecutionDecisionAttributes *FailWorkflowExecutionDecisionAttributes // Provides the details of the RecordMarker decision. It isn't set for other // decision types. RecordMarkerDecisionAttributes *RecordMarkerDecisionAttributes // Provides the details of the RequestCancelActivityTask decision. It isn't set // for other decision types. RequestCancelActivityTaskDecisionAttributes *RequestCancelActivityTaskDecisionAttributes // Provides the details of the RequestCancelExternalWorkflowExecution decision. It // isn't set for other decision types. RequestCancelExternalWorkflowExecutionDecisionAttributes *RequestCancelExternalWorkflowExecutionDecisionAttributes // Provides the details of the ScheduleActivityTask decision. It isn't set for // other decision types. ScheduleActivityTaskDecisionAttributes *ScheduleActivityTaskDecisionAttributes // Provides the details of the ScheduleLambdaFunction decision. It isn't set for // other decision types. ScheduleLambdaFunctionDecisionAttributes *ScheduleLambdaFunctionDecisionAttributes // Provides the details of the SignalExternalWorkflowExecution decision. It isn't // set for other decision types. SignalExternalWorkflowExecutionDecisionAttributes *SignalExternalWorkflowExecutionDecisionAttributes // Provides the details of the StartChildWorkflowExecution decision. It isn't set // for other decision types. StartChildWorkflowExecutionDecisionAttributes *StartChildWorkflowExecutionDecisionAttributes // Provides the details of the StartTimer decision. It isn't set for other // decision types. StartTimerDecisionAttributes *StartTimerDecisionAttributes noSmithyDocumentSerde } // Provides the details of the DecisionTaskCompleted event. type DecisionTaskCompletedEventAttributes struct { // The ID of the DecisionTaskScheduled event that was recorded when this decision // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the DecisionTaskStarted event recorded when this decision task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // User defined context for the workflow execution. ExecutionContext *string noSmithyDocumentSerde } // Provides details about the DecisionTaskScheduled event. type DecisionTaskScheduledEventAttributes struct { // The name of the task list in which the decision task was scheduled. // // This member is required. TaskList *TaskList // The maximum duration for this decision task. The task is considered timed out // if it doesn't completed within this duration. The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. StartToCloseTimeout *string // A task priority that, if set, specifies the priority for this decision task. // Valid values are integers that range from Java's Integer.MIN_VALUE // (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher // priority. For more information about setting task priority, see Setting Task // Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string noSmithyDocumentSerde } // Provides the details of the DecisionTaskStarted event. type DecisionTaskStartedEventAttributes struct { // The ID of the DecisionTaskScheduled event that was recorded when this decision // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // Identity of the decider making the request. This enables diagnostic tracing // when problems arise. The form of this identity is user defined. Identity *string noSmithyDocumentSerde } // Provides the details of the DecisionTaskTimedOut event. type DecisionTaskTimedOutEventAttributes struct { // The ID of the DecisionTaskScheduled event that was recorded when this decision // task was scheduled. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the DecisionTaskStarted event recorded when this decision task was // started. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. StartedEventId int64 // The type of timeout that expired before the decision task could be completed. // // This member is required. TimeoutType DecisionTaskTimeoutType noSmithyDocumentSerde } // Contains the configuration settings of a domain. type DomainConfiguration struct { // The retention period for workflow executions in this domain. // // This member is required. WorkflowExecutionRetentionPeriodInDays *string noSmithyDocumentSerde } // Contains general information about a domain. type DomainInfo struct { // The name of the domain. This name is unique within the account. // // This member is required. Name *string // The status of the domain: // - REGISTERED – The domain is properly registered and available. You can use // this domain for registering types and creating new workflow executions. // - DEPRECATED – The domain was deprecated using DeprecateDomain , but is still // in use. You should not create new workflow executions in this domain. // // This member is required. Status RegistrationStatus // The ARN of the domain. Arn *string // The description of the domain provided through RegisterDomain . Description *string noSmithyDocumentSerde } // Used to filter the workflow executions in visibility APIs by various time-based // rules. Each parameter, if specified, defines a rule that must be satisfied by // each returned query result. The parameter values are in the Unix Time format (https://en.wikipedia.org/wiki/Unix_time) // . For example: "oldestDate": 1325376070. type ExecutionTimeFilter struct { // Specifies the oldest start or close date and time to return. // // This member is required. OldestDate *time.Time // Specifies the latest start or close date and time to return. LatestDate *time.Time noSmithyDocumentSerde } // Provides the details of the ExternalWorkflowExecutionCancelRequested event. type ExternalWorkflowExecutionCancelRequestedEventAttributes struct { // The ID of the RequestCancelExternalWorkflowExecutionInitiated event // corresponding to the RequestCancelExternalWorkflowExecution decision to cancel // this external workflow execution. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. InitiatedEventId int64 // The external workflow execution to which the cancellation request was delivered. // // This member is required. WorkflowExecution *WorkflowExecution noSmithyDocumentSerde } // Provides the details of the ExternalWorkflowExecutionSignaled event. type ExternalWorkflowExecutionSignaledEventAttributes struct { // The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to // the SignalExternalWorkflowExecution decision to request this signal. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. InitiatedEventId int64 // The external workflow execution that the signal was delivered to. // // This member is required. WorkflowExecution *WorkflowExecution noSmithyDocumentSerde } // Provides the details of the FailWorkflowExecution decision. Access Control You // can use IAM policies to control this decision's access to Amazon SWF resources // as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type FailWorkflowExecutionDecisionAttributes struct { // Details of the failure. Details *string // A descriptive reason for the failure that may help in diagnostics. Reason *string noSmithyDocumentSerde } // Provides the details of the FailWorkflowExecutionFailed event. type FailWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause FailWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the FailWorkflowExecution decision to fail this execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Event within a workflow execution. A history event can be one of these types: // // - ActivityTaskCancelRequested – A RequestCancelActivityTask decision was // received by the system. // // - ActivityTaskCanceled – The activity task was successfully canceled. // // - ActivityTaskCompleted – An activity worker successfully completed an // activity task by calling RespondActivityTaskCompleted . // // - ActivityTaskFailed – An activity worker failed an activity task by calling // RespondActivityTaskFailed . // // - ActivityTaskScheduled – An activity task was scheduled for execution. // // - ActivityTaskStarted – The scheduled activity task was dispatched to a // worker. // // - ActivityTaskTimedOut – The activity task timed out. // // - CancelTimerFailed – Failed to process CancelTimer decision. This happens // when the decision isn't configured properly, for example no timer exists with // the specified timer Id. // // - CancelWorkflowExecutionFailed – A request to cancel a workflow execution // failed. // // - ChildWorkflowExecutionCanceled – A child workflow execution, started by this // workflow execution, was canceled and closed. // // - ChildWorkflowExecutionCompleted – A child workflow execution, started by // this workflow execution, completed successfully and was closed. // // - ChildWorkflowExecutionFailed – A child workflow execution, started by this // workflow execution, failed to complete successfully and was closed. // // - ChildWorkflowExecutionStarted – A child workflow execution was successfully // started. // // - ChildWorkflowExecutionTerminated – A child workflow execution, started by // this workflow execution, was terminated. // // - ChildWorkflowExecutionTimedOut – A child workflow execution, started by this // workflow execution, timed out and was closed. // // - CompleteWorkflowExecutionFailed – The workflow execution failed to complete. // // - ContinueAsNewWorkflowExecutionFailed – The workflow execution failed to // complete after being continued as a new workflow execution. // // - DecisionTaskCompleted – The decider successfully completed a decision task // by calling RespondDecisionTaskCompleted . // // - DecisionTaskScheduled – A decision task was scheduled for the workflow // execution. // // - DecisionTaskStarted – The decision task was dispatched to a decider. // // - DecisionTaskTimedOut – The decision task timed out. // // - ExternalWorkflowExecutionCancelRequested – Request to cancel an external // workflow execution was successfully delivered to the target execution. // // - ExternalWorkflowExecutionSignaled – A signal, requested by this workflow // execution, was successfully delivered to the target external workflow execution. // // - FailWorkflowExecutionFailed – A request to mark a workflow execution as // failed, itself failed. // // - MarkerRecorded – A marker was recorded in the workflow history as the result // of a RecordMarker decision. // // - RecordMarkerFailed – A RecordMarker decision was returned as failed. // // - RequestCancelActivityTaskFailed – Failed to process // RequestCancelActivityTask decision. This happens when the decision isn't // configured properly. // // - RequestCancelExternalWorkflowExecutionFailed – Request to cancel an external // workflow execution failed. // // - RequestCancelExternalWorkflowExecutionInitiated – A request was made to // request the cancellation of an external workflow execution. // // - ScheduleActivityTaskFailed – Failed to process ScheduleActivityTask // decision. This happens when the decision isn't configured properly, for example // the activity type specified isn't registered. // // - SignalExternalWorkflowExecutionFailed – The request to signal an external // workflow execution failed. // // - SignalExternalWorkflowExecutionInitiated – A request to signal an external // workflow was made. // // - StartActivityTaskFailed – A scheduled activity task failed to start. // // - StartChildWorkflowExecutionFailed – Failed to process // StartChildWorkflowExecution decision. This happens when the decision isn't // configured properly, for example the workflow type specified isn't registered. // // - StartChildWorkflowExecutionInitiated – A request was made to start a child // workflow execution. // // - StartTimerFailed – Failed to process StartTimer decision. This happens when // the decision isn't configured properly, for example a timer already exists with // the specified timer Id. // // - TimerCanceled – A timer, previously started for this workflow execution, was // successfully canceled. // // - TimerFired – A timer, previously started for this workflow execution, fired. // // - TimerStarted – A timer was started for the workflow execution due to a // StartTimer decision. // // - WorkflowExecutionCancelRequested – A request to cancel this workflow // execution was made. // // - WorkflowExecutionCanceled – The workflow execution was successfully canceled // and closed. // // - WorkflowExecutionCompleted – The workflow execution was closed due to // successful completion. // // - WorkflowExecutionContinuedAsNew – The workflow execution was closed and a // new execution of the same type was created with the same workflowId. // // - WorkflowExecutionFailed – The workflow execution closed due to a failure. // // - WorkflowExecutionSignaled – An external signal was received for the workflow // execution. // // - WorkflowExecutionStarted – The workflow execution was started. // // - WorkflowExecutionTerminated – The workflow execution was terminated. // // - WorkflowExecutionTimedOut – The workflow execution was closed because a time // out was exceeded. type HistoryEvent struct { // The system generated ID of the event. This ID uniquely identifies the event // with in the workflow execution history. // // This member is required. EventId int64 // The date and time when the event occurred. // // This member is required. EventTimestamp *time.Time // The type of the history event. // // This member is required. EventType EventType // If the event is of type ActivityTaskcancelRequested then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskCancelRequestedEventAttributes *ActivityTaskCancelRequestedEventAttributes // If the event is of type ActivityTaskCanceled then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskCanceledEventAttributes *ActivityTaskCanceledEventAttributes // If the event is of type ActivityTaskCompleted then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskCompletedEventAttributes *ActivityTaskCompletedEventAttributes // If the event is of type ActivityTaskFailed then this member is set and provides // detailed information about the event. It isn't set for other event types. ActivityTaskFailedEventAttributes *ActivityTaskFailedEventAttributes // If the event is of type ActivityTaskScheduled then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskScheduledEventAttributes *ActivityTaskScheduledEventAttributes // If the event is of type ActivityTaskStarted then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskStartedEventAttributes *ActivityTaskStartedEventAttributes // If the event is of type ActivityTaskTimedOut then this member is set and // provides detailed information about the event. It isn't set for other event // types. ActivityTaskTimedOutEventAttributes *ActivityTaskTimedOutEventAttributes // If the event is of type CancelTimerFailed then this member is set and provides // detailed information about the event. It isn't set for other event types. CancelTimerFailedEventAttributes *CancelTimerFailedEventAttributes // If the event is of type CancelWorkflowExecutionFailed then this member is set // and provides detailed information about the event. It isn't set for other event // types. CancelWorkflowExecutionFailedEventAttributes *CancelWorkflowExecutionFailedEventAttributes // If the event is of type ChildWorkflowExecutionCanceled then this member is set // and provides detailed information about the event. It isn't set for other event // types. ChildWorkflowExecutionCanceledEventAttributes *ChildWorkflowExecutionCanceledEventAttributes // If the event is of type ChildWorkflowExecutionCompleted then this member is set // and provides detailed information about the event. It isn't set for other event // types. ChildWorkflowExecutionCompletedEventAttributes *ChildWorkflowExecutionCompletedEventAttributes // If the event is of type ChildWorkflowExecutionFailed then this member is set // and provides detailed information about the event. It isn't set for other event // types. ChildWorkflowExecutionFailedEventAttributes *ChildWorkflowExecutionFailedEventAttributes // If the event is of type ChildWorkflowExecutionStarted then this member is set // and provides detailed information about the event. It isn't set for other event // types. ChildWorkflowExecutionStartedEventAttributes *ChildWorkflowExecutionStartedEventAttributes // If the event is of type ChildWorkflowExecutionTerminated then this member is // set and provides detailed information about the event. It isn't set for other // event types. ChildWorkflowExecutionTerminatedEventAttributes *ChildWorkflowExecutionTerminatedEventAttributes // If the event is of type ChildWorkflowExecutionTimedOut then this member is set // and provides detailed information about the event. It isn't set for other event // types. ChildWorkflowExecutionTimedOutEventAttributes *ChildWorkflowExecutionTimedOutEventAttributes // If the event is of type CompleteWorkflowExecutionFailed then this member is set // and provides detailed information about the event. It isn't set for other event // types. CompleteWorkflowExecutionFailedEventAttributes *CompleteWorkflowExecutionFailedEventAttributes // If the event is of type ContinueAsNewWorkflowExecutionFailed then this member // is set and provides detailed information about the event. It isn't set for other // event types. ContinueAsNewWorkflowExecutionFailedEventAttributes *ContinueAsNewWorkflowExecutionFailedEventAttributes // If the event is of type DecisionTaskCompleted then this member is set and // provides detailed information about the event. It isn't set for other event // types. DecisionTaskCompletedEventAttributes *DecisionTaskCompletedEventAttributes // If the event is of type DecisionTaskScheduled then this member is set and // provides detailed information about the event. It isn't set for other event // types. DecisionTaskScheduledEventAttributes *DecisionTaskScheduledEventAttributes // If the event is of type DecisionTaskStarted then this member is set and // provides detailed information about the event. It isn't set for other event // types. DecisionTaskStartedEventAttributes *DecisionTaskStartedEventAttributes // If the event is of type DecisionTaskTimedOut then this member is set and // provides detailed information about the event. It isn't set for other event // types. DecisionTaskTimedOutEventAttributes *DecisionTaskTimedOutEventAttributes // If the event is of type ExternalWorkflowExecutionCancelRequested then this // member is set and provides detailed information about the event. It isn't set // for other event types. ExternalWorkflowExecutionCancelRequestedEventAttributes *ExternalWorkflowExecutionCancelRequestedEventAttributes // If the event is of type ExternalWorkflowExecutionSignaled then this member is // set and provides detailed information about the event. It isn't set for other // event types. ExternalWorkflowExecutionSignaledEventAttributes *ExternalWorkflowExecutionSignaledEventAttributes // If the event is of type FailWorkflowExecutionFailed then this member is set and // provides detailed information about the event. It isn't set for other event // types. FailWorkflowExecutionFailedEventAttributes *FailWorkflowExecutionFailedEventAttributes // Provides the details of the LambdaFunctionCompleted event. It isn't set for // other event types. LambdaFunctionCompletedEventAttributes *LambdaFunctionCompletedEventAttributes // Provides the details of the LambdaFunctionFailed event. It isn't set for other // event types. LambdaFunctionFailedEventAttributes *LambdaFunctionFailedEventAttributes // Provides the details of the LambdaFunctionScheduled event. It isn't set for // other event types. LambdaFunctionScheduledEventAttributes *LambdaFunctionScheduledEventAttributes // Provides the details of the LambdaFunctionStarted event. It isn't set for other // event types. LambdaFunctionStartedEventAttributes *LambdaFunctionStartedEventAttributes // Provides the details of the LambdaFunctionTimedOut event. It isn't set for // other event types. LambdaFunctionTimedOutEventAttributes *LambdaFunctionTimedOutEventAttributes // If the event is of type MarkerRecorded then this member is set and provides // detailed information about the event. It isn't set for other event types. MarkerRecordedEventAttributes *MarkerRecordedEventAttributes // If the event is of type DecisionTaskFailed then this member is set and provides // detailed information about the event. It isn't set for other event types. RecordMarkerFailedEventAttributes *RecordMarkerFailedEventAttributes // If the event is of type RequestCancelActivityTaskFailed then this member is set // and provides detailed information about the event. It isn't set for other event // types. RequestCancelActivityTaskFailedEventAttributes *RequestCancelActivityTaskFailedEventAttributes // If the event is of type RequestCancelExternalWorkflowExecutionFailed then this // member is set and provides detailed information about the event. It isn't set // for other event types. RequestCancelExternalWorkflowExecutionFailedEventAttributes *RequestCancelExternalWorkflowExecutionFailedEventAttributes // If the event is of type RequestCancelExternalWorkflowExecutionInitiated then // this member is set and provides detailed information about the event. It isn't // set for other event types. RequestCancelExternalWorkflowExecutionInitiatedEventAttributes *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes // If the event is of type ScheduleActivityTaskFailed then this member is set and // provides detailed information about the event. It isn't set for other event // types. ScheduleActivityTaskFailedEventAttributes *ScheduleActivityTaskFailedEventAttributes // Provides the details of the ScheduleLambdaFunctionFailed event. It isn't set // for other event types. ScheduleLambdaFunctionFailedEventAttributes *ScheduleLambdaFunctionFailedEventAttributes // If the event is of type SignalExternalWorkflowExecutionFailed then this member // is set and provides detailed information about the event. It isn't set for other // event types. SignalExternalWorkflowExecutionFailedEventAttributes *SignalExternalWorkflowExecutionFailedEventAttributes // If the event is of type SignalExternalWorkflowExecutionInitiated then this // member is set and provides detailed information about the event. It isn't set // for other event types. SignalExternalWorkflowExecutionInitiatedEventAttributes *SignalExternalWorkflowExecutionInitiatedEventAttributes // If the event is of type StartChildWorkflowExecutionFailed then this member is // set and provides detailed information about the event. It isn't set for other // event types. StartChildWorkflowExecutionFailedEventAttributes *StartChildWorkflowExecutionFailedEventAttributes // If the event is of type StartChildWorkflowExecutionInitiated then this member // is set and provides detailed information about the event. It isn't set for other // event types. StartChildWorkflowExecutionInitiatedEventAttributes *StartChildWorkflowExecutionInitiatedEventAttributes // Provides the details of the StartLambdaFunctionFailed event. It isn't set for // other event types. StartLambdaFunctionFailedEventAttributes *StartLambdaFunctionFailedEventAttributes // If the event is of type StartTimerFailed then this member is set and provides // detailed information about the event. It isn't set for other event types. StartTimerFailedEventAttributes *StartTimerFailedEventAttributes // If the event is of type TimerCanceled then this member is set and provides // detailed information about the event. It isn't set for other event types. TimerCanceledEventAttributes *TimerCanceledEventAttributes // If the event is of type TimerFired then this member is set and provides // detailed information about the event. It isn't set for other event types. TimerFiredEventAttributes *TimerFiredEventAttributes // If the event is of type TimerStarted then this member is set and provides // detailed information about the event. It isn't set for other event types. TimerStartedEventAttributes *TimerStartedEventAttributes // If the event is of type WorkflowExecutionCancelRequested then this member is // set and provides detailed information about the event. It isn't set for other // event types. WorkflowExecutionCancelRequestedEventAttributes *WorkflowExecutionCancelRequestedEventAttributes // If the event is of type WorkflowExecutionCanceled then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionCanceledEventAttributes *WorkflowExecutionCanceledEventAttributes // If the event is of type WorkflowExecutionCompleted then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionCompletedEventAttributes *WorkflowExecutionCompletedEventAttributes // If the event is of type WorkflowExecutionContinuedAsNew then this member is set // and provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionContinuedAsNewEventAttributes *WorkflowExecutionContinuedAsNewEventAttributes // If the event is of type WorkflowExecutionFailed then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionFailedEventAttributes *WorkflowExecutionFailedEventAttributes // If the event is of type WorkflowExecutionSignaled then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionSignaledEventAttributes *WorkflowExecutionSignaledEventAttributes // If the event is of type WorkflowExecutionStarted then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionStartedEventAttributes *WorkflowExecutionStartedEventAttributes // If the event is of type WorkflowExecutionTerminated then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionTerminatedEventAttributes *WorkflowExecutionTerminatedEventAttributes // If the event is of type WorkflowExecutionTimedOut then this member is set and // provides detailed information about the event. It isn't set for other event // types. WorkflowExecutionTimedOutEventAttributes *WorkflowExecutionTimedOutEventAttributes noSmithyDocumentSerde } // Provides the details of the LambdaFunctionCompleted event. It isn't set for // other event types. type LambdaFunctionCompletedEventAttributes struct { // The ID of the LambdaFunctionScheduled event that was recorded when this Lambda // task was scheduled. To help diagnose issues, use this information to trace back // the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the LambdaFunctionStarted event recorded when this activity task // started. To help diagnose issues, use this information to trace back the chain // of events leading up to this event. // // This member is required. StartedEventId int64 // The results of the Lambda task. Result *string noSmithyDocumentSerde } // Provides the details of the LambdaFunctionFailed event. It isn't set for other // event types. type LambdaFunctionFailedEventAttributes struct { // The ID of the LambdaFunctionScheduled event that was recorded when this // activity task was scheduled. To help diagnose issues, use this information to // trace back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the LambdaFunctionStarted event recorded when this activity task // started. To help diagnose issues, use this information to trace back the chain // of events leading up to this event. // // This member is required. StartedEventId int64 // The details of the failure. Details *string // The reason provided for the failure. Reason *string noSmithyDocumentSerde } // Provides the details of the LambdaFunctionScheduled event. It isn't set for // other event types. type LambdaFunctionScheduledEventAttributes struct { // The ID of the LambdaFunctionCompleted event corresponding to the decision that // resulted in scheduling this activity task. To help diagnose issues, use this // information to trace back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The unique ID of the Lambda task. // // This member is required. Id *string // The name of the Lambda function. // // This member is required. Name *string // Data attached to the event that the decider can use in subsequent workflow // tasks. This data isn't sent to the Lambda task. Control *string // The input provided to the Lambda task. Input *string // The maximum amount of time a worker can take to process the Lambda task. StartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the LambdaFunctionStarted event. It isn't set for other // event types. type LambdaFunctionStartedEventAttributes struct { // The ID of the LambdaFunctionScheduled event that was recorded when this // activity task was scheduled. To help diagnose issues, use this information to // trace back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 noSmithyDocumentSerde } // Provides details of the LambdaFunctionTimedOut event. type LambdaFunctionTimedOutEventAttributes struct { // The ID of the LambdaFunctionScheduled event that was recorded when this // activity task was scheduled. To help diagnose issues, use this information to // trace back the chain of events leading up to this event. // // This member is required. ScheduledEventId int64 // The ID of the ActivityTaskStarted event that was recorded when this activity // task started. To help diagnose issues, use this information to trace back the // chain of events leading up to this event. // // This member is required. StartedEventId int64 // The type of the timeout that caused this event. TimeoutType LambdaFunctionTimeoutType noSmithyDocumentSerde } // Provides the details of the MarkerRecorded event. type MarkerRecordedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RecordMarker decision that requested this marker. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The name of the marker. // // This member is required. MarkerName *string // The details of the marker. Details *string noSmithyDocumentSerde } // Provides the details of the RecordMarker decision. Access Control You can use // IAM policies to control this decision's access to Amazon SWF resources as // follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type RecordMarkerDecisionAttributes struct { // The name of the marker. // // This member is required. MarkerName *string // The details of the marker. Details *string noSmithyDocumentSerde } // Provides the details of the RecordMarkerFailed event. type RecordMarkerFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause RecordMarkerFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RecordMarkerFailed decision for this cancellation request. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The marker's name. // // This member is required. MarkerName *string noSmithyDocumentSerde } // Provides the details of the RequestCancelActivityTask decision. Access Control // You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type RequestCancelActivityTaskDecisionAttributes struct { // The activityId of the activity task to be canceled. // // This member is required. ActivityId *string noSmithyDocumentSerde } // Provides the details of the RequestCancelActivityTaskFailed event. type RequestCancelActivityTaskFailedEventAttributes struct { // The activityId provided in the RequestCancelActivityTask decision that failed. // // This member is required. ActivityId *string // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause RequestCancelActivityTaskFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RequestCancelActivityTask decision for this cancellation // request. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Provides the details of the RequestCancelExternalWorkflowExecution decision. // Access Control You can use IAM policies to control this decision's access to // Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type RequestCancelExternalWorkflowExecutionDecisionAttributes struct { // The workflowId of the external workflow execution to cancel. // // This member is required. WorkflowId *string // The data attached to the event that can be used by the decider in subsequent // workflow tasks. Control *string // The runId of the external workflow execution to cancel. RunId *string noSmithyDocumentSerde } // Provides the details of the RequestCancelExternalWorkflowExecutionFailed event. type RequestCancelExternalWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause RequestCancelExternalWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RequestCancelExternalWorkflowExecution decision for this // cancellation request. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The ID of the RequestCancelExternalWorkflowExecutionInitiated event // corresponding to the RequestCancelExternalWorkflowExecution decision to cancel // this external workflow execution. This information can be useful for diagnosing // problems by tracing back the chain of events leading up to this event. // // This member is required. InitiatedEventId int64 // The workflowId of the external workflow to which the cancel request was to be // delivered. // // This member is required. WorkflowId *string // The data attached to the event that the decider can use in subsequent workflow // tasks. This data isn't sent to the workflow execution. Control *string // The runId of the external workflow execution. RunId *string noSmithyDocumentSerde } // Provides the details of the RequestCancelExternalWorkflowExecutionInitiated // event. type RequestCancelExternalWorkflowExecutionInitiatedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the RequestCancelExternalWorkflowExecution decision for this // cancellation request. This information can be useful for diagnosing problems by // tracing back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The workflowId of the external workflow execution to be canceled. // // This member is required. WorkflowId *string // Data attached to the event that can be used by the decider in subsequent // workflow tasks. Control *string // The runId of the external workflow execution to be canceled. RunId *string noSmithyDocumentSerde } // Tags are key-value pairs that can be associated with Amazon SWF state machines // and activities. Tags may only contain unicode letters, digits, whitespace, or // these symbols: _ . : / = + - @ . type ResourceTag struct { // The key of a tag. // // This member is required. Key *string // The value of a tag. Value *string noSmithyDocumentSerde } // Provides the details of the ScheduleActivityTask decision. Access Control You // can use IAM policies to control this decision's access to Amazon SWF resources // as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - activityType.name – String constraint. The key is swf:activityType.name . // - activityType.version – String constraint. The key is // swf:activityType.version . // - taskList – String constraint. The key is swf:taskList.name . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type ScheduleActivityTaskDecisionAttributes struct { // The activityId of the activity task. The specified string must not contain a : // (colon), / (slash), | (vertical bar), or any control characters ( \u0000-\u001f // | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. ActivityId *string // The type of the activity task to schedule. // // This member is required. ActivityType *ActivityType // Data attached to the event that can be used by the decider in subsequent // workflow tasks. This data isn't sent to the activity. Control *string // If set, specifies the maximum time before which a worker processing a task of // this type must report progress by calling RecordActivityTaskHeartbeat . If the // timeout is exceeded, the activity task is automatically timed out. If the worker // subsequently attempts to record a heartbeat or returns a result, it is ignored. // This overrides the default heartbeat timeout specified when registering the // activity type using RegisterActivityType . The duration is specified in seconds, // an integer greater than or equal to 0 . You can use NONE to specify unlimited // duration. HeartbeatTimeout *string // The input provided to the activity task. Input *string // The maximum duration for this activity task. The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. A schedule-to-close timeout for this activity task must be // specified either as a default for the activity type or through this field. If // neither this field is set nor a default schedule-to-close timeout was specified // at registration time then a fault is returned. ScheduleToCloseTimeout *string // If set, specifies the maximum duration the activity task can wait to be // assigned to a worker. This overrides the default schedule-to-start timeout // specified when registering the activity type using RegisterActivityType . The // duration is specified in seconds, an integer greater than or equal to 0 . You // can use NONE to specify unlimited duration. A schedule-to-start timeout for // this activity task must be specified either as a default for the activity type // or through this field. If neither this field is set nor a default // schedule-to-start timeout was specified at registration time then a fault is // returned. ScheduleToStartTimeout *string // If set, specifies the maximum duration a worker may take to process this // activity task. This overrides the default start-to-close timeout specified when // registering the activity type using RegisterActivityType . The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. A start-to-close timeout for this activity task // must be specified either as a default for the activity type or through this // field. If neither this field is set nor a default start-to-close timeout was // specified at registration time then a fault is returned. StartToCloseTimeout *string // If set, specifies the name of the task list in which to schedule the activity // task. If not specified, the defaultTaskList registered with the activity type // is used. A task list for this activity task must be specified either as a // default for the activity type or through this field. If neither this field is // set nor a default task list was specified at registration time then a fault is // returned. The specified string must not contain a : (colon), / (slash), | // (vertical bar), or any control characters ( \u0000-\u001f | \u007f-\u009f ). // Also, it must not be the literal string arn . TaskList *TaskList // If set, specifies the priority with which the activity task is to be assigned // to a worker. This overrides the defaultTaskPriority specified when registering // the activity type using RegisterActivityType . Valid values are integers that // range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE // (2147483647). Higher numbers indicate higher priority. For more information // about setting task priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string noSmithyDocumentSerde } // Provides the details of the ScheduleActivityTaskFailed event. type ScheduleActivityTaskFailedEventAttributes struct { // The activityId provided in the ScheduleActivityTask decision that failed. // // This member is required. ActivityId *string // The activity type provided in the ScheduleActivityTask decision that failed. // // This member is required. ActivityType *ActivityType // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause ScheduleActivityTaskFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision that // resulted in the scheduling of this activity task. This information can be useful // for diagnosing problems by tracing back the chain of events leading up to this // event. // // This member is required. DecisionTaskCompletedEventId int64 noSmithyDocumentSerde } // Decision attributes specified in scheduleLambdaFunctionDecisionAttributes // within the list of decisions decisions passed to RespondDecisionTaskCompleted . type ScheduleLambdaFunctionDecisionAttributes struct { // A string that identifies the Lambda function execution in the event history. // // This member is required. Id *string // The name, or ARN, of the Lambda function to schedule. // // This member is required. Name *string // The data attached to the event that the decider can use in subsequent workflow // tasks. This data isn't sent to the Lambda task. Control *string // The optional input data to be supplied to the Lambda function. Input *string // The timeout value, in seconds, after which the Lambda function is considered to // be failed once it has started. This can be any integer from 1-900 (1s-15m). If // no value is supplied, then a default value of 900s is assumed. StartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the ScheduleLambdaFunctionFailed event. It isn't set // for other event types. type ScheduleLambdaFunctionFailedEventAttributes struct { // The cause of the failure. To help diagnose issues, use this information to // trace back the chain of events leading up to this event. If cause is set to // OPERATION_NOT_PERMITTED , the decision failed because it lacked sufficient // permissions. For details and example IAM policies, see Using IAM to Manage // Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause ScheduleLambdaFunctionFailedCause // The ID of the LambdaFunctionCompleted event corresponding to the decision that // resulted in scheduling this Lambda task. To help diagnose issues, use this // information to trace back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The ID provided in the ScheduleLambdaFunction decision that failed. // // This member is required. Id *string // The name of the Lambda function. // // This member is required. Name *string noSmithyDocumentSerde } // Provides the details of the SignalExternalWorkflowExecution decision. Access // Control You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type SignalExternalWorkflowExecutionDecisionAttributes struct { // The name of the signal.The target workflow execution uses the signal name and // input to process the signal. // // This member is required. SignalName *string // The workflowId of the workflow execution to be signaled. // // This member is required. WorkflowId *string // The data attached to the event that can be used by the decider in subsequent // decision tasks. Control *string // The input data to be provided with the signal. The target workflow execution // uses the signal name and input data to process the signal. Input *string // The runId of the workflow execution to be signaled. RunId *string noSmithyDocumentSerde } // Provides the details of the SignalExternalWorkflowExecutionFailed event. type SignalExternalWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause SignalExternalWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the SignalExternalWorkflowExecution decision for this signal. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to // the SignalExternalWorkflowExecution decision to request this signal. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. InitiatedEventId int64 // The workflowId of the external workflow execution that the signal was being // delivered to. // // This member is required. WorkflowId *string // The data attached to the event that the decider can use in subsequent workflow // tasks. This data isn't sent to the workflow execution. Control *string // The runId of the external workflow execution that the signal was being // delivered to. RunId *string noSmithyDocumentSerde } // Provides the details of the SignalExternalWorkflowExecutionInitiated event. type SignalExternalWorkflowExecutionInitiatedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the SignalExternalWorkflowExecution decision for this signal. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The name of the signal. // // This member is required. SignalName *string // The workflowId of the external workflow execution. // // This member is required. WorkflowId *string // Data attached to the event that can be used by the decider in subsequent // decision tasks. Control *string // The input provided to the signal. Input *string // The runId of the external workflow execution to send the signal to. RunId *string noSmithyDocumentSerde } // Provides the details of the StartChildWorkflowExecution decision. Access // Control You can use IAM policies to control this decision's access to Amazon SWF // resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - Constrain the following parameters by using a Condition element with the // appropriate keys. // - tagList.member.N – The key is "swf:tagList.N" where N is the tag number from // 0 to 4, inclusive. // - taskList – String constraint. The key is swf:taskList.name . // - workflowType.name – String constraint. The key is swf:workflowType.name . // - workflowType.version – String constraint. The key is // swf:workflowType.version . // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type StartChildWorkflowExecutionDecisionAttributes struct { // The workflowId of the workflow execution. The specified string must not contain // a : (colon), / (slash), | (vertical bar), or any control characters ( // \u0000-\u001f | \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. WorkflowId *string // The type of the workflow execution to be started. // // This member is required. WorkflowType *WorkflowType // If set, specifies the policy to use for the child workflow executions if the // workflow execution being started is terminated by calling the // TerminateWorkflowExecution action explicitly or due to an expired timeout. This // policy overrides the default child policy specified when registering the // workflow type using RegisterWorkflowType . The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // A child policy for this workflow execution must be specified either as a // default for the workflow type or through this parameter. If neither this // parameter is set nor a default child policy was specified at registration time // then a fault is returned. ChildPolicy ChildPolicy // The data attached to the event that can be used by the decider in subsequent // workflow tasks. This data isn't sent to the child workflow execution. Control *string // The total duration for this workflow execution. This overrides the // defaultExecutionStartToCloseTimeout specified when registering the workflow // type. The duration is specified in seconds, an integer greater than or equal to // 0 . You can use NONE to specify unlimited duration. An execution start-to-close // timeout for this workflow execution must be specified either as a default for // the workflow type or through this parameter. If neither this parameter is set // nor a default execution start-to-close timeout was specified at registration // time then a fault is returned. ExecutionStartToCloseTimeout *string // The input to be provided to the workflow execution. Input *string // The IAM role attached to the child workflow execution. LambdaRole *string // The list of tags to associate with the child workflow execution. A maximum of 5 // tags can be specified. You can list workflow executions with a specific tag by // calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and // specifying a TagFilter . TagList []string // The name of the task list to be used for decision tasks of the child workflow // execution. A task list for this workflow execution must be specified either as a // default for the workflow type or through this parameter. If neither this // parameter is set nor a default task list was specified at registration time then // a fault is returned. The specified string must not start or end with whitespace. // It must not contain a : (colon), / (slash), | (vertical bar), or any control // characters ( \u0000-\u001f | \u007f-\u009f ). Also, it must not be the literal // string arn . TaskList *TaskList // A task priority that, if set, specifies the priority for a decision task of // this workflow execution. This overrides the defaultTaskPriority specified when // registering the workflow type. Valid values are integers that range from Java's // Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher // numbers indicate higher priority. For more information about setting task // priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string // Specifies the maximum duration of decision tasks for this workflow execution. // This parameter overrides the defaultTaskStartToCloseTimout specified when // registering the workflow type using RegisterWorkflowType . The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. A task start-to-close timeout for this workflow // execution must be specified either as a default for the workflow type or through // this parameter. If neither this parameter is set nor a default task // start-to-close timeout was specified at registration time then a fault is // returned. TaskStartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the StartChildWorkflowExecutionFailed event. type StartChildWorkflowExecutionFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. When cause is set to OPERATION_NOT_PERMITTED // , the decision fails because it lacks sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause StartChildWorkflowExecutionFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the StartChildWorkflowExecution Decision to request this child // workflow execution. This information can be useful for diagnosing problems by // tracing back the chain of events. // // This member is required. DecisionTaskCompletedEventId int64 // When the cause is WORKFLOW_ALREADY_RUNNING , initiatedEventId is the ID of the // StartChildWorkflowExecutionInitiated event that corresponds to the // StartChildWorkflowExecution Decision to start the workflow execution. You can // use this information to diagnose problems by tracing back the chain of events // leading up to this event. When the cause isn't WORKFLOW_ALREADY_RUNNING , // initiatedEventId is set to 0 because the StartChildWorkflowExecutionInitiated // event doesn't exist. // // This member is required. InitiatedEventId int64 // The workflowId of the child workflow execution. // // This member is required. WorkflowId *string // The workflow type provided in the StartChildWorkflowExecution Decision that // failed. // // This member is required. WorkflowType *WorkflowType // The data attached to the event that the decider can use in subsequent workflow // tasks. This data isn't sent to the child workflow execution. Control *string noSmithyDocumentSerde } // Provides the details of the StartChildWorkflowExecutionInitiated event. type StartChildWorkflowExecutionInitiatedEventAttributes struct { // The policy to use for the child workflow executions if this execution gets // terminated by explicitly calling the TerminateWorkflowExecution action or due // to an expired timeout. The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the StartChildWorkflowExecution Decision to request this child // workflow execution. This information can be useful for diagnosing problems by // tracing back the cause of events. // // This member is required. DecisionTaskCompletedEventId int64 // The name of the task list used for the decision tasks of the child workflow // execution. // // This member is required. TaskList *TaskList // The workflowId of the child workflow execution. // // This member is required. WorkflowId *string // The type of the child workflow execution. // // This member is required. WorkflowType *WorkflowType // Data attached to the event that can be used by the decider in subsequent // decision tasks. This data isn't sent to the activity. Control *string // The maximum duration for the child workflow execution. If the workflow // execution isn't closed within this duration, it is timed out and // force-terminated. The duration is specified in seconds, an integer greater than // or equal to 0 . You can use NONE to specify unlimited duration. ExecutionStartToCloseTimeout *string // The inputs provided to the child workflow execution. Input *string // The IAM role to attach to the child workflow execution. LambdaRole *string // The list of tags to associated with the child workflow execution. TagList []string // The priority assigned for the decision tasks for this workflow execution. Valid // values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to // Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For // more information about setting task priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string // The maximum duration allowed for the decision tasks for this workflow // execution. The duration is specified in seconds, an integer greater than or // equal to 0 . You can use NONE to specify unlimited duration. TaskStartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the StartLambdaFunctionFailed event. It isn't set for // other event types. type StartLambdaFunctionFailedEventAttributes struct { // The cause of the failure. To help diagnose issues, use this information to // trace back the chain of events leading up to this event. If cause is set to // OPERATION_NOT_PERMITTED , the decision failed because the IAM role attached to // the execution lacked sufficient permissions. For details and example IAM // policies, see Lambda Tasks (https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html) // in the Amazon SWF Developer Guide. Cause StartLambdaFunctionFailedCause // A description that can help diagnose the cause of the fault. Message *string // The ID of the ActivityTaskScheduled event that was recorded when this activity // task was scheduled. To help diagnose issues, use this information to trace back // the chain of events leading up to this event. ScheduledEventId int64 noSmithyDocumentSerde } // Provides the details of the StartTimer decision. Access Control You can use IAM // policies to control this decision's access to Amazon SWF resources as follows: // - Use a Resource element with the domain name to limit the action to only // specified domains. // - Use an Action element to allow or deny permission to call this action. // - You cannot use an IAM policy to constrain this action's parameters. // // If the caller doesn't have sufficient permissions to invoke the action, or the // parameter values fall outside the specified constraints, the action fails. The // associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED . // For details and example IAM policies, see Using IAM to Manage Access to Amazon // SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. type StartTimerDecisionAttributes struct { // The duration to wait before firing the timer. The duration is specified in // seconds, an integer greater than or equal to 0 . // // This member is required. StartToFireTimeout *string // The unique ID of the timer. The specified string must not contain a : (colon), / // (slash), | (vertical bar), or any control characters ( \u0000-\u001f | // \u007f-\u009f ). Also, it must not be the literal string arn . // // This member is required. TimerId *string // The data attached to the event that can be used by the decider in subsequent // workflow tasks. Control *string noSmithyDocumentSerde } // Provides the details of the StartTimerFailed event. type StartTimerFailedEventAttributes struct { // The cause of the failure. This information is generated by the system and can // be useful for diagnostic purposes. If cause is set to OPERATION_NOT_PERMITTED , // the decision failed because it lacked sufficient permissions. For details and // example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) // in the Amazon SWF Developer Guide. // // This member is required. Cause StartTimerFailedCause // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the StartTimer decision for this activity task. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The timerId provided in the StartTimer decision that failed. // // This member is required. TimerId *string noSmithyDocumentSerde } // Used to filter the workflow executions in visibility APIs based on a tag. type TagFilter struct { // Specifies the tag that must be associated with the execution for it to meet the // filter criteria. Tags may only contain unicode letters, digits, whitespace, or // these symbols: _ . : / = + - @ . // // This member is required. Tag *string noSmithyDocumentSerde } // Represents a task list. type TaskList struct { // The name of the task list. // // This member is required. Name *string noSmithyDocumentSerde } // Provides the details of the TimerCanceled event. type TimerCanceledEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CancelTimer decision to cancel this timer. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The ID of the TimerStarted event that was recorded when this timer was started. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. StartedEventId int64 // The unique ID of the timer that was canceled. // // This member is required. TimerId *string noSmithyDocumentSerde } // Provides the details of the TimerFired event. type TimerFiredEventAttributes struct { // The ID of the TimerStarted event that was recorded when this timer was started. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. StartedEventId int64 // The unique ID of the timer that fired. // // This member is required. TimerId *string noSmithyDocumentSerde } // Provides the details of the TimerStarted event. type TimerStartedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the StartTimer decision for this activity task. This // information can be useful for diagnosing problems by tracing back the chain of // events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The duration of time after which the timer fires. The duration is specified in // seconds, an integer greater than or equal to 0 . // // This member is required. StartToFireTimeout *string // The unique ID of the timer that was started. // // This member is required. TimerId *string // Data attached to the event that can be used by the decider in subsequent // workflow tasks. Control *string noSmithyDocumentSerde } // Represents a workflow execution. type WorkflowExecution struct { // A system-generated unique identifier for the workflow execution. // // This member is required. RunId *string // The user defined identifier associated with the workflow execution. // // This member is required. WorkflowId *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionCanceled event. type WorkflowExecutionCanceledEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CancelWorkflowExecution decision for this cancellation // request. This information can be useful for diagnosing problems by tracing back // the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The details of the cancellation. Details *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionCancelRequested event. type WorkflowExecutionCancelRequestedEventAttributes struct { // If set, indicates that the request to cancel the workflow execution was // automatically generated, and specifies the cause. This happens if the parent // workflow execution times out or is terminated, and the child policy is set to // cancel child executions. Cause WorkflowExecutionCancelRequestedCause // The ID of the RequestCancelExternalWorkflowExecutionInitiated event // corresponding to the RequestCancelExternalWorkflowExecution decision to cancel // this workflow execution.The source event with this ID can be found in the // history of the source workflow execution. This information can be useful for // diagnosing problems by tracing back the chain of events leading up to this // event. ExternalInitiatedEventId int64 // The external workflow execution for which the cancellation was requested. ExternalWorkflowExecution *WorkflowExecution noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionCompleted event. type WorkflowExecutionCompletedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the CompleteWorkflowExecution decision to complete this // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The result produced by the workflow execution upon successful completion. Result *string noSmithyDocumentSerde } // The configuration settings for a workflow execution including timeout values, // tasklist etc. These configuration settings are determined from the defaults // specified when registering the workflow type and those specified when starting // the workflow execution. type WorkflowExecutionConfiguration struct { // The policy to use for the child workflow executions if this workflow execution // is terminated, by calling the TerminateWorkflowExecution action explicitly or // due to an expired timeout. The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // The total duration for this workflow execution. The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. // // This member is required. ExecutionStartToCloseTimeout *string // The task list used for the decision tasks generated for this workflow execution. // // This member is required. TaskList *TaskList // The maximum duration allowed for decision tasks for this workflow execution. // The duration is specified in seconds, an integer greater than or equal to 0 . // You can use NONE to specify unlimited duration. // // This member is required. TaskStartToCloseTimeout *string // The IAM role attached to the child workflow execution. LambdaRole *string // The priority assigned to decision tasks for this workflow execution. Valid // values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to // Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For // more information about setting task priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. TaskPriority *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionContinuedAsNew event. type WorkflowExecutionContinuedAsNewEventAttributes struct { // The policy to use for the child workflow executions of the new execution if it // is terminated by calling the TerminateWorkflowExecution action explicitly or // due to an expired timeout. The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the ContinueAsNewWorkflowExecution decision that started this // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The runId of the new workflow execution. // // This member is required. NewExecutionRunId *string // The task list to use for the decisions of the new (continued) workflow // execution. // // This member is required. TaskList *TaskList // The workflow type of this execution. // // This member is required. WorkflowType *WorkflowType // The total duration allowed for the new workflow execution. The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. ExecutionStartToCloseTimeout *string // The input provided to the new workflow execution. Input *string // The IAM role to attach to the new (continued) workflow execution. LambdaRole *string // The list of tags associated with the new workflow execution. TagList []string // The priority of the task to use for the decisions of the new (continued) // workflow execution. TaskPriority *string // The maximum duration of decision tasks for the new workflow execution. The // duration is specified in seconds, an integer greater than or equal to 0 . You // can use NONE to specify unlimited duration. TaskStartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionFailed event. type WorkflowExecutionFailedEventAttributes struct { // The ID of the DecisionTaskCompleted event corresponding to the decision task // that resulted in the FailWorkflowExecution decision to fail this execution. // This information can be useful for diagnosing problems by tracing back the chain // of events leading up to this event. // // This member is required. DecisionTaskCompletedEventId int64 // The details of the failure. Details *string // The descriptive reason provided for the failure. Reason *string noSmithyDocumentSerde } // Used to filter the workflow executions in visibility APIs by their workflowId . type WorkflowExecutionFilter struct { // The workflowId to pass of match the criteria of this filter. // // This member is required. WorkflowId *string noSmithyDocumentSerde } // Contains information about a workflow execution. type WorkflowExecutionInfo struct { // The workflow execution this information is about. // // This member is required. Execution *WorkflowExecution // The current status of the execution. // // This member is required. ExecutionStatus ExecutionStatus // The time when the execution was started. // // This member is required. StartTimestamp *time.Time // The type of the workflow execution. // // This member is required. WorkflowType *WorkflowType // Set to true if a cancellation is requested for this workflow execution. CancelRequested bool // If the execution status is closed then this specifies how the execution was // closed: // - COMPLETED – the execution was successfully completed. // - CANCELED – the execution was canceled.Cancellation allows the implementation // to gracefully clean up before the execution is closed. // - TERMINATED – the execution was force terminated. // - FAILED – the execution failed to complete. // - TIMED_OUT – the execution did not complete in the alloted time and was // automatically timed out. // - CONTINUED_AS_NEW – the execution is logically continued. This means the // current execution was completed and a new execution was started to carry on the // workflow. CloseStatus CloseStatus // The time when the workflow execution was closed. Set only if the execution // status is CLOSED. CloseTimestamp *time.Time // If this workflow execution is a child of another execution then contains the // workflow execution that started this execution. Parent *WorkflowExecution // The list of tags associated with the workflow execution. Tags can be used to // identify and list workflow executions of interest through the visibility APIs. A // workflow execution can have a maximum of 5 tags. TagList []string noSmithyDocumentSerde } // Contains the counts of open tasks, child workflow executions and timers for a // workflow execution. type WorkflowExecutionOpenCounts struct { // The count of activity tasks whose status is OPEN . // // This member is required. OpenActivityTasks int32 // The count of child workflow executions whose status is OPEN . // // This member is required. OpenChildWorkflowExecutions int32 // The count of decision tasks whose status is OPEN. A workflow execution can have // at most one open decision task. // // This member is required. OpenDecisionTasks int32 // The count of timers started by this workflow execution that have not fired yet. // // This member is required. OpenTimers int32 // The count of Lambda tasks whose status is OPEN . OpenLambdaFunctions int32 noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionSignaled event. type WorkflowExecutionSignaledEventAttributes struct { // The name of the signal received. The decider can use the signal name and inputs // to determine how to the process the signal. // // This member is required. SignalName *string // The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to // the SignalExternalWorkflow decision to signal this workflow execution.The // source event with this ID can be found in the history of the source workflow // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. This field is set only if the // signal was initiated by another workflow execution. ExternalInitiatedEventId int64 // The workflow execution that sent the signal. This is set only of the signal was // sent by another workflow execution. ExternalWorkflowExecution *WorkflowExecution // The inputs provided with the signal. The decider can use the signal name and // inputs to determine how to process the signal. Input *string noSmithyDocumentSerde } // Provides details of WorkflowExecutionStarted event. type WorkflowExecutionStartedEventAttributes struct { // The policy to use for the child workflow executions if this workflow execution // is terminated, by calling the TerminateWorkflowExecution action explicitly or // due to an expired timeout. The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // The name of the task list for scheduling the decision tasks for this workflow // execution. // // This member is required. TaskList *TaskList // The workflow type of this execution. // // This member is required. WorkflowType *WorkflowType // If this workflow execution was started due to a ContinueAsNewWorkflowExecution // decision, then it contains the runId of the previous workflow execution that // was closed and continued as this execution. ContinuedExecutionRunId *string // The maximum duration for this workflow execution. The duration is specified in // seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. ExecutionStartToCloseTimeout *string // The input provided to the workflow execution. Input *string // The IAM role attached to the workflow execution. LambdaRole *string // The ID of the StartChildWorkflowExecutionInitiated event corresponding to the // StartChildWorkflowExecution Decision to start this workflow execution. The // source event with this ID can be found in the history of the source workflow // execution. This information can be useful for diagnosing problems by tracing // back the chain of events leading up to this event. ParentInitiatedEventId int64 // The source workflow execution that started this workflow execution. The member // isn't set if the workflow execution was not started by a workflow. ParentWorkflowExecution *WorkflowExecution // The list of tags associated with this workflow execution. An execution can have // up to 5 tags. TagList []string // The priority of the decision tasks in the workflow execution. TaskPriority *string // The maximum duration of decision tasks for this workflow type. The duration is // specified in seconds, an integer greater than or equal to 0 . You can use NONE // to specify unlimited duration. TaskStartToCloseTimeout *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionTerminated event. type WorkflowExecutionTerminatedEventAttributes struct { // The policy used for the child workflow executions of this workflow execution. // The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // If set, indicates that the workflow execution was automatically terminated, and // specifies the cause. This happens if the parent workflow execution times out or // is terminated and the child policy is set to terminate child executions. Cause WorkflowExecutionTerminatedCause // The details provided for the termination. Details *string // The reason provided for the termination. Reason *string noSmithyDocumentSerde } // Provides the details of the WorkflowExecutionTimedOut event. type WorkflowExecutionTimedOutEventAttributes struct { // The policy used for the child workflow executions of this workflow execution. // The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. // // This member is required. ChildPolicy ChildPolicy // The type of timeout that caused this event. // // This member is required. TimeoutType WorkflowExecutionTimeoutType noSmithyDocumentSerde } // Represents a workflow type. type WorkflowType struct { // The name of the workflow type. The combination of workflow type name and // version must be unique with in a domain. // // This member is required. Name *string // The version of the workflow type. The combination of workflow type name and // version must be unique with in a domain. // // This member is required. Version *string noSmithyDocumentSerde } // The configuration settings of a workflow type. type WorkflowTypeConfiguration struct { // The default policy to use for the child workflow executions when a workflow // execution of this type is terminated, by calling the TerminateWorkflowExecution // action explicitly or due to an expired timeout. This default can be overridden // when starting a workflow execution using the StartWorkflowExecution action or // the StartChildWorkflowExecution Decision . The supported child policies are: // - TERMINATE – The child executions are terminated. // - REQUEST_CANCEL – A request to cancel is attempted for each child execution // by recording a WorkflowExecutionCancelRequested event in its history. It is up // to the decider to take appropriate actions when it receives an execution history // with this event. // - ABANDON – No action is taken. The child executions continue to run. DefaultChildPolicy ChildPolicy // The default maximum duration, specified when registering the workflow type, for // executions of this workflow type. This default can be overridden when starting a // workflow execution using the StartWorkflowExecution action or the // StartChildWorkflowExecution Decision . The duration is specified in seconds, an // integer greater than or equal to 0 . You can use NONE to specify unlimited // duration. DefaultExecutionStartToCloseTimeout *string // The default IAM role attached to this workflow type. Executions of this // workflow type need IAM roles to invoke Lambda functions. If you don't specify an // IAM role when starting this workflow type, the default Lambda role is attached // to the execution. For more information, see // https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html (https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html) // in the Amazon SWF Developer Guide. DefaultLambdaRole *string // The default task list, specified when registering the workflow type, for // decisions tasks scheduled for workflow executions of this type. This default can // be overridden when starting a workflow execution using the // StartWorkflowExecution action or the StartChildWorkflowExecution Decision . DefaultTaskList *TaskList // The default task priority, specified when registering the workflow type, for // all decision tasks of this workflow type. This default can be overridden when // starting a workflow execution using the StartWorkflowExecution action or the // StartChildWorkflowExecution decision. Valid values are integers that range from // Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). // Higher numbers indicate higher priority. For more information about setting task // priority, see Setting Task Priority (https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html) // in the Amazon SWF Developer Guide. DefaultTaskPriority *string // The default maximum duration, specified when registering the workflow type, // that a decision task for executions of this workflow type might take before // returning completion or failure. If the task doesn'tdo close in the specified // time then the task is automatically timed out and rescheduled. If the decider // eventually reports a completion or failure, it is ignored. This default can be // overridden when starting a workflow execution using the StartWorkflowExecution // action or the StartChildWorkflowExecution Decision . The duration is specified // in seconds, an integer greater than or equal to 0 . You can use NONE to specify // unlimited duration. DefaultTaskStartToCloseTimeout *string noSmithyDocumentSerde } // Used to filter workflow execution query results by type. Each parameter, if // specified, defines a rule that must be satisfied by each returned result. type WorkflowTypeFilter struct { // Name of the workflow type. // // This member is required. Name *string // Version of the workflow type. Version *string noSmithyDocumentSerde } // Contains information about a workflow type. type WorkflowTypeInfo struct { // The date when this type was registered. // // This member is required. CreationDate *time.Time // The current status of the workflow type. // // This member is required. Status RegistrationStatus // The workflow type this information is about. // // This member is required. WorkflowType *WorkflowType // If the type is in deprecated state, then it is set to the date when the type // was deprecated. DeprecationDate *time.Time // The description of the type registered through RegisterWorkflowType . Description *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
3,284
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "synthetics" const ServiceAPIVersion = "2017-10-11" // Client provides the API client to make operations call for Synthetics. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "synthetics", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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 synthetics 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" ) // Associates a canary with a group. Using groups can help you with managing and // automating your canaries, and you can also view aggregated run results and // statistics for all canaries in a group. You must run this operation in the // Region where the canary exists. func (c *Client) AssociateResource(ctx context.Context, params *AssociateResourceInput, optFns ...func(*Options)) (*AssociateResourceOutput, error) { if params == nil { params = &AssociateResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateResource", params, optFns, c.addOperationAssociateResourceMiddlewares) if err != nil { return nil, err } out := result.(*AssociateResourceOutput) out.ResultMetadata = metadata return out, nil } type AssociateResourceInput struct { // Specifies the group. You can specify the group name, the ARN, or the group ID // as the GroupIdentifier . // // This member is required. GroupIdentifier *string // The ARN of the canary that you want to associate with the specified group. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type AssociateResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAssociateResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "AssociateResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a canary. Canaries are scripts that monitor your endpoints and APIs // from the outside-in. Canaries help you check the availability and latency of // your web services and troubleshoot anomalies by investigating load time data, // screenshots of the UI, logs, and metrics. You can set up a canary to run // continuously or just once. Do not use CreateCanary to modify an existing // canary. Use UpdateCanary (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_UpdateCanary.html) // instead. To create canaries, you must have the CloudWatchSyntheticsFullAccess // policy. If you are creating a new IAM role for the canary, you also need the // iam:CreateRole , iam:CreatePolicy and iam:AttachRolePolicy permissions. For // more information, see Necessary Roles and Permissions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Roles) // . Do not include secrets or proprietary information in your canary names. The // canary name makes up part of the Amazon Resource Name (ARN) for the canary, and // the ARN is included in outbound calls over the internet. For more information, // see Security Considerations for Synthetics Canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html) // . func (c *Client) CreateCanary(ctx context.Context, params *CreateCanaryInput, optFns ...func(*Options)) (*CreateCanaryOutput, error) { if params == nil { params = &CreateCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCanary", params, optFns, c.addOperationCreateCanaryMiddlewares) if err != nil { return nil, err } out := result.(*CreateCanaryOutput) out.ResultMetadata = metadata return out, nil } type CreateCanaryInput struct { // The location in Amazon S3 where Synthetics stores artifacts from the test runs // of this canary. Artifacts include the log file, screenshots, and HAR files. The // name of the S3 bucket can't include a period (.). // // This member is required. ArtifactS3Location *string // A structure that includes the entry point from which the canary should start // running your script. If the script is stored in an S3 bucket, the bucket name, // key, and version are also included. // // This member is required. Code *types.CanaryCodeInput // The ARN of the IAM role to be used to run the canary. This role must already // exist, and must include lambda.amazonaws.com as a principal in the trust // policy. The role must also have the following permissions: // - s3:PutObject // - s3:GetBucketLocation // - s3:ListAllMyBuckets // - cloudwatch:PutMetricData // - logs:CreateLogGroup // - logs:CreateLogStream // - logs:PutLogEvents // // This member is required. ExecutionRoleArn *string // The name for this canary. Be sure to give it a descriptive name that // distinguishes it from other canaries in your account. Do not include secrets or // proprietary information in your canary names. The canary name makes up part of // the canary ARN, and the ARN is included in outbound calls over the internet. For // more information, see Security Considerations for Synthetics Canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html) // . // // This member is required. Name *string // Specifies the runtime version to use for the canary. For a list of valid // runtime versions and more information about runtime versions, see Canary // Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . // // This member is required. RuntimeVersion *string // A structure that contains information about how often the canary is to run and // when these test runs are to stop. // // This member is required. Schedule *types.CanaryScheduleInput // A structure that contains the configuration for canary artifacts, including the // encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. ArtifactConfig *types.ArtifactConfigInput // The number of days to retain data about failed runs of this canary. If you omit // this field, the default of 31 days is used. The valid range is 1 to 455 days. FailureRetentionPeriodInDays *int32 // A structure that contains the configuration for individual canary runs, such as // timeout value and environment variables. The environment variables keys and // values are not encrypted. Do not store sensitive information in this field. RunConfig *types.CanaryRunConfigInput // The number of days to retain data about successful runs of this canary. If you // omit this field, the default of 31 days is used. The valid range is 1 to 455 // days. SuccessRetentionPeriodInDays *int32 // A list of key-value pairs to associate with the canary. You can associate as // many as 50 tags with a canary. Tags can help you organize and categorize your // resources. You can also use them to scope user permissions, by granting a user // permission to access or change only the resources that have certain tag values. Tags map[string]string // If this canary is to test an endpoint in a VPC, this structure contains // information about the subnet and security groups of the VPC endpoint. For more // information, see Running a Canary in a VPC (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html) // . VpcConfig *types.VpcConfigInput noSmithyDocumentSerde } type CreateCanaryOutput struct { // The full details about the canary you have created. Canary *types.Canary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "CreateCanary", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a group which you can use to associate canaries with each other, // including cross-Region canaries. Using groups can help you with managing and // automating your canaries, and you can also view aggregated run results and // statistics for all canaries in a group. Groups are global resources. When you // create a group, it is replicated across Amazon Web Services Regions, and you can // view it and add canaries to it from any Region. Although the group ARN format // reflects the Region name where it was created, a group is not constrained to any // Region. This means that you can put canaries from multiple Regions into the same // group, and then use that group to view and manage all of those canaries in a // single view. Groups are supported in all Regions except the Regions that are // disabled by default. For more information about these Regions, see Enabling a // Region (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable) // . Each group can contain as many as 10 canaries. You can have as many as 20 // groups in your account. Any single canary can be a member of up to 10 groups. func (c *Client) CreateGroup(ctx context.Context, params *CreateGroupInput, optFns ...func(*Options)) (*CreateGroupOutput, error) { if params == nil { params = &CreateGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateGroup", params, optFns, c.addOperationCreateGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateGroupInput struct { // The name for the group. It can include any Unicode characters. The names for // all groups in your account, across all Regions, must be unique. // // This member is required. Name *string // A list of key-value pairs to associate with the group. You can associate as // many as 50 tags with a group. Tags can help you organize and categorize your // resources. You can also use them to scope user permissions, by granting a user // permission to access or change only the resources that have certain tag values. Tags map[string]string noSmithyDocumentSerde } type CreateGroupOutput struct { // A structure that contains information about the group that was just created. Group *types.Group // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "CreateGroup", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // Permanently deletes the specified canary. If you specify DeleteLambda to true , // CloudWatch Synthetics also deletes the Lambda functions and layers that are used // by the canary. Other resources used and created by the canary are not // automatically deleted. After you delete a canary that you do not intend to use // again, you should also delete the following: // - The CloudWatch alarms created for this canary. These alarms have a name of // Synthetics-SharpDrop-Alarm-MyCanaryName . // - Amazon S3 objects and buckets, such as the canary's artifact location. // - IAM roles created for the canary. If they were created in the console, // these roles have the name // role/service-role/CloudWatchSyntheticsRole-MyCanaryName . // - CloudWatch Logs log groups created for the canary. These logs groups have // the name /aws/lambda/cwsyn-MyCanaryName . // // Before you delete a canary, you might want to use GetCanary to display the // information about this canary. Make note of the information returned by this // operation so that you can delete these resources after you delete the canary. func (c *Client) DeleteCanary(ctx context.Context, params *DeleteCanaryInput, optFns ...func(*Options)) (*DeleteCanaryOutput, error) { if params == nil { params = &DeleteCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCanary", params, optFns, c.addOperationDeleteCanaryMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCanaryOutput) out.ResultMetadata = metadata return out, nil } type DeleteCanaryInput struct { // The name of the canary that you want to delete. To find the names of your // canaries, use DescribeCanaries (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html) // . // // This member is required. Name *string // Specifies whether to also delete the Lambda functions and layers used by this // canary. The default is false. Type: Boolean DeleteLambda bool noSmithyDocumentSerde } type DeleteCanaryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DeleteCanary", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a group. The group doesn't need to be empty to be deleted. If there are // canaries in the group, they are not deleted when you delete the group. Groups // are a global resource that appear in all Regions, but the request to delete a // group must be made from its home Region. You can find the home Region of a group // within its ARN. func (c *Client) DeleteGroup(ctx context.Context, params *DeleteGroupInput, optFns ...func(*Options)) (*DeleteGroupOutput, error) { if params == nil { params = &DeleteGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteGroup", params, optFns, c.addOperationDeleteGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeleteGroupOutput) out.ResultMetadata = metadata return out, nil } type DeleteGroupInput struct { // Specifies which group to delete. You can specify the group name, the ARN, or // the group ID as the GroupIdentifier . // // This member is required. GroupIdentifier *string noSmithyDocumentSerde } type DeleteGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DeleteGroup", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation returns a list of the canaries in your account, along with full // details about each canary. This operation supports resource-level authorization // using an IAM policy and the Names parameter. If you specify the Names // parameter, the operation is successful only if you have authorization to view // all the canaries that you specify in your request. If you do not have permission // to view any of the canaries, the request fails with a 403 response. You are // required to use the Names parameter if you are logged on to a user or role that // has an IAM policy that restricts which canaries that you are allowed to view. // For more information, see Limiting a user to viewing specific canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html) // . func (c *Client) DescribeCanaries(ctx context.Context, params *DescribeCanariesInput, optFns ...func(*Options)) (*DescribeCanariesOutput, error) { if params == nil { params = &DescribeCanariesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCanaries", params, optFns, c.addOperationDescribeCanariesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeCanariesOutput) out.ResultMetadata = metadata return out, nil } type DescribeCanariesInput struct { // Specify this parameter to limit how many canaries are returned each time you // use the DescribeCanaries operation. If you omit this parameter, the default of // 100 is used. MaxResults *int32 // Use this parameter to return only canaries that match the names that you // specify here. You can specify as many as five canary names. If you specify this // parameter, the operation is successful only if you have authorization to view // all the canaries that you specify in your request. If you do not have permission // to view any of the canaries, the request fails with a 403 response. You are // required to use this parameter if you are logged on to a user or role that has // an IAM policy that restricts which canaries that you are allowed to view. For // more information, see Limiting a user to viewing specific canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html) // . Names []string // A token that indicates that there is more data available. You can use this // token in a subsequent operation to retrieve the next set of results. NextToken *string noSmithyDocumentSerde } type DescribeCanariesOutput struct { // Returns an array. Each item in the array contains the full information about // one canary. Canaries []types.Canary // A token that indicates that there is more data available. You can use this // token in a subsequent DescribeCanaries operation to retrieve the next set of // results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeCanariesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCanaries{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCanaries{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeCanaries(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeCanariesAPIClient is a client that implements the DescribeCanaries // operation. type DescribeCanariesAPIClient interface { DescribeCanaries(context.Context, *DescribeCanariesInput, ...func(*Options)) (*DescribeCanariesOutput, error) } var _ DescribeCanariesAPIClient = (*Client)(nil) // DescribeCanariesPaginatorOptions is the paginator options for DescribeCanaries type DescribeCanariesPaginatorOptions struct { // Specify this parameter to limit how many canaries are returned each time you // use the DescribeCanaries operation. If you omit this parameter, the default of // 100 is used. 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 } // DescribeCanariesPaginator is a paginator for DescribeCanaries type DescribeCanariesPaginator struct { options DescribeCanariesPaginatorOptions client DescribeCanariesAPIClient params *DescribeCanariesInput nextToken *string firstPage bool } // NewDescribeCanariesPaginator returns a new DescribeCanariesPaginator func NewDescribeCanariesPaginator(client DescribeCanariesAPIClient, params *DescribeCanariesInput, optFns ...func(*DescribeCanariesPaginatorOptions)) *DescribeCanariesPaginator { if params == nil { params = &DescribeCanariesInput{} } options := DescribeCanariesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeCanariesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeCanariesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeCanaries page. func (p *DescribeCanariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesOutput, 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.DescribeCanaries(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_opDescribeCanaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DescribeCanaries", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Use this operation to see information from the most recent run of each canary // that you have created. This operation supports resource-level authorization // using an IAM policy and the Names parameter. If you specify the Names // parameter, the operation is successful only if you have authorization to view // all the canaries that you specify in your request. If you do not have permission // to view any of the canaries, the request fails with a 403 response. You are // required to use the Names parameter if you are logged on to a user or role that // has an IAM policy that restricts which canaries that you are allowed to view. // For more information, see Limiting a user to viewing specific canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html) // . func (c *Client) DescribeCanariesLastRun(ctx context.Context, params *DescribeCanariesLastRunInput, optFns ...func(*Options)) (*DescribeCanariesLastRunOutput, error) { if params == nil { params = &DescribeCanariesLastRunInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCanariesLastRun", params, optFns, c.addOperationDescribeCanariesLastRunMiddlewares) if err != nil { return nil, err } out := result.(*DescribeCanariesLastRunOutput) out.ResultMetadata = metadata return out, nil } type DescribeCanariesLastRunInput struct { // Specify this parameter to limit how many runs are returned each time you use // the DescribeLastRun operation. If you omit this parameter, the default of 100 // is used. MaxResults *int32 // Use this parameter to return only canaries that match the names that you // specify here. You can specify as many as five canary names. If you specify this // parameter, the operation is successful only if you have authorization to view // all the canaries that you specify in your request. If you do not have permission // to view any of the canaries, the request fails with a 403 response. You are // required to use the Names parameter if you are logged on to a user or role that // has an IAM policy that restricts which canaries that you are allowed to view. // For more information, see Limiting a user to viewing specific canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html) // . Names []string // A token that indicates that there is more data available. You can use this // token in a subsequent DescribeCanariesLastRun operation to retrieve the next // set of results. NextToken *string noSmithyDocumentSerde } type DescribeCanariesLastRunOutput struct { // An array that contains the information from the most recent run of each canary. CanariesLastRun []types.CanaryLastRun // A token that indicates that there is more data available. You can use this // token in a subsequent DescribeCanariesLastRun operation to retrieve the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeCanariesLastRunMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCanariesLastRun{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCanariesLastRun{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeCanariesLastRun(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeCanariesLastRunAPIClient is a client that implements the // DescribeCanariesLastRun operation. type DescribeCanariesLastRunAPIClient interface { DescribeCanariesLastRun(context.Context, *DescribeCanariesLastRunInput, ...func(*Options)) (*DescribeCanariesLastRunOutput, error) } var _ DescribeCanariesLastRunAPIClient = (*Client)(nil) // DescribeCanariesLastRunPaginatorOptions is the paginator options for // DescribeCanariesLastRun type DescribeCanariesLastRunPaginatorOptions struct { // Specify this parameter to limit how many runs are returned each time you use // the DescribeLastRun operation. If you omit this parameter, the default of 100 // is used. 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 } // DescribeCanariesLastRunPaginator is a paginator for DescribeCanariesLastRun type DescribeCanariesLastRunPaginator struct { options DescribeCanariesLastRunPaginatorOptions client DescribeCanariesLastRunAPIClient params *DescribeCanariesLastRunInput nextToken *string firstPage bool } // NewDescribeCanariesLastRunPaginator returns a new // DescribeCanariesLastRunPaginator func NewDescribeCanariesLastRunPaginator(client DescribeCanariesLastRunAPIClient, params *DescribeCanariesLastRunInput, optFns ...func(*DescribeCanariesLastRunPaginatorOptions)) *DescribeCanariesLastRunPaginator { if params == nil { params = &DescribeCanariesLastRunInput{} } options := DescribeCanariesLastRunPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeCanariesLastRunPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeCanariesLastRunPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeCanariesLastRun page. func (p *DescribeCanariesLastRunPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesLastRunOutput, 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.DescribeCanariesLastRun(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_opDescribeCanariesLastRun(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DescribeCanariesLastRun", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of Synthetics canary runtime versions. For more information, see // Canary Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . func (c *Client) DescribeRuntimeVersions(ctx context.Context, params *DescribeRuntimeVersionsInput, optFns ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) { if params == nil { params = &DescribeRuntimeVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeRuntimeVersions", params, optFns, c.addOperationDescribeRuntimeVersionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeRuntimeVersionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeRuntimeVersionsInput struct { // Specify this parameter to limit how many runs are returned each time you use // the DescribeRuntimeVersions operation. If you omit this parameter, the default // of 100 is used. MaxResults *int32 // A token that indicates that there is more data available. You can use this // token in a subsequent DescribeRuntimeVersions operation to retrieve the next // set of results. NextToken *string noSmithyDocumentSerde } type DescribeRuntimeVersionsOutput struct { // A token that indicates that there is more data available. You can use this // token in a subsequent DescribeRuntimeVersions operation to retrieve the next // set of results. NextToken *string // An array of objects that display the details about each Synthetics canary // runtime version. RuntimeVersions []types.RuntimeVersion // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeRuntimeVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRuntimeVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRuntimeVersions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeRuntimeVersions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeRuntimeVersionsAPIClient is a client that implements the // DescribeRuntimeVersions operation. type DescribeRuntimeVersionsAPIClient interface { DescribeRuntimeVersions(context.Context, *DescribeRuntimeVersionsInput, ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) } var _ DescribeRuntimeVersionsAPIClient = (*Client)(nil) // DescribeRuntimeVersionsPaginatorOptions is the paginator options for // DescribeRuntimeVersions type DescribeRuntimeVersionsPaginatorOptions struct { // Specify this parameter to limit how many runs are returned each time you use // the DescribeRuntimeVersions operation. If you omit this parameter, the default // of 100 is used. 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 } // DescribeRuntimeVersionsPaginator is a paginator for DescribeRuntimeVersions type DescribeRuntimeVersionsPaginator struct { options DescribeRuntimeVersionsPaginatorOptions client DescribeRuntimeVersionsAPIClient params *DescribeRuntimeVersionsInput nextToken *string firstPage bool } // NewDescribeRuntimeVersionsPaginator returns a new // DescribeRuntimeVersionsPaginator func NewDescribeRuntimeVersionsPaginator(client DescribeRuntimeVersionsAPIClient, params *DescribeRuntimeVersionsInput, optFns ...func(*DescribeRuntimeVersionsPaginatorOptions)) *DescribeRuntimeVersionsPaginator { if params == nil { params = &DescribeRuntimeVersionsInput{} } options := DescribeRuntimeVersionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeRuntimeVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeRuntimeVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeRuntimeVersions page. func (p *DescribeRuntimeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRuntimeVersionsOutput, 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.DescribeRuntimeVersions(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_opDescribeRuntimeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DescribeRuntimeVersions", } }
230
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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 canary from a group. You must run this operation in the Region where // the canary exists. func (c *Client) DisassociateResource(ctx context.Context, params *DisassociateResourceInput, optFns ...func(*Options)) (*DisassociateResourceOutput, error) { if params == nil { params = &DisassociateResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateResource", params, optFns, c.addOperationDisassociateResourceMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateResourceOutput) out.ResultMetadata = metadata return out, nil } type DisassociateResourceInput struct { // Specifies the group. You can specify the group name, the ARN, or the group ID // as the GroupIdentifier . // // This member is required. GroupIdentifier *string // The ARN of the canary that you want to remove from the specified group. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type DisassociateResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisassociateResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "DisassociateResource", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves complete information about one canary. You must specify the name of // the canary that you want. To get a list of canaries and their names, use // DescribeCanaries (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html) // . func (c *Client) GetCanary(ctx context.Context, params *GetCanaryInput, optFns ...func(*Options)) (*GetCanaryOutput, error) { if params == nil { params = &GetCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCanary", params, optFns, c.addOperationGetCanaryMiddlewares) if err != nil { return nil, err } out := result.(*GetCanaryOutput) out.ResultMetadata = metadata return out, nil } type GetCanaryInput struct { // The name of the canary that you want details for. // // This member is required. Name *string noSmithyDocumentSerde } type GetCanaryOutput struct { // A structure that contains the full information about the canary. Canary *types.Canary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "GetCanary", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a list of runs for a specified canary. func (c *Client) GetCanaryRuns(ctx context.Context, params *GetCanaryRunsInput, optFns ...func(*Options)) (*GetCanaryRunsOutput, error) { if params == nil { params = &GetCanaryRunsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCanaryRuns", params, optFns, c.addOperationGetCanaryRunsMiddlewares) if err != nil { return nil, err } out := result.(*GetCanaryRunsOutput) out.ResultMetadata = metadata return out, nil } type GetCanaryRunsInput struct { // The name of the canary that you want to see runs for. // // This member is required. Name *string // Specify this parameter to limit how many runs are returned each time you use // the GetCanaryRuns operation. If you omit this parameter, the default of 100 is // used. MaxResults *int32 // A token that indicates that there is more data available. You can use this // token in a subsequent GetCanaryRuns operation to retrieve the next set of // results. NextToken *string noSmithyDocumentSerde } type GetCanaryRunsOutput struct { // An array of structures. Each structure contains the details of one of the // retrieved canary runs. CanaryRuns []types.CanaryRun // A token that indicates that there is more data available. You can use this // token in a subsequent GetCanaryRuns operation to retrieve the next set of // results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCanaryRunsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCanaryRuns{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCanaryRuns{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCanaryRunsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCanaryRuns(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetCanaryRunsAPIClient is a client that implements the GetCanaryRuns operation. type GetCanaryRunsAPIClient interface { GetCanaryRuns(context.Context, *GetCanaryRunsInput, ...func(*Options)) (*GetCanaryRunsOutput, error) } var _ GetCanaryRunsAPIClient = (*Client)(nil) // GetCanaryRunsPaginatorOptions is the paginator options for GetCanaryRuns type GetCanaryRunsPaginatorOptions struct { // Specify this parameter to limit how many runs are returned each time you use // the GetCanaryRuns operation. If you omit this parameter, the default of 100 is // used. 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 } // GetCanaryRunsPaginator is a paginator for GetCanaryRuns type GetCanaryRunsPaginator struct { options GetCanaryRunsPaginatorOptions client GetCanaryRunsAPIClient params *GetCanaryRunsInput nextToken *string firstPage bool } // NewGetCanaryRunsPaginator returns a new GetCanaryRunsPaginator func NewGetCanaryRunsPaginator(client GetCanaryRunsAPIClient, params *GetCanaryRunsInput, optFns ...func(*GetCanaryRunsPaginatorOptions)) *GetCanaryRunsPaginator { if params == nil { params = &GetCanaryRunsInput{} } options := GetCanaryRunsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetCanaryRunsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetCanaryRunsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetCanaryRuns page. func (p *GetCanaryRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCanaryRunsOutput, 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.GetCanaryRuns(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_opGetCanaryRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "GetCanaryRuns", } }
233
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about one group. Groups are a global resource, so you can // use this operation from any Region. func (c *Client) GetGroup(ctx context.Context, params *GetGroupInput, optFns ...func(*Options)) (*GetGroupOutput, error) { if params == nil { params = &GetGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "GetGroup", params, optFns, c.addOperationGetGroupMiddlewares) if err != nil { return nil, err } out := result.(*GetGroupOutput) out.ResultMetadata = metadata return out, nil } type GetGroupInput struct { // Specifies the group to return information for. You can specify the group name, // the ARN, or the group ID as the GroupIdentifier . // // This member is required. GroupIdentifier *string noSmithyDocumentSerde } type GetGroupOutput struct { // A structure that contains information about the group. Group *types.Group // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "GetGroup", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the groups that the specified canary is associated with. The // canary that you specify must be in the current Region. func (c *Client) ListAssociatedGroups(ctx context.Context, params *ListAssociatedGroupsInput, optFns ...func(*Options)) (*ListAssociatedGroupsOutput, error) { if params == nil { params = &ListAssociatedGroupsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAssociatedGroups", params, optFns, c.addOperationListAssociatedGroupsMiddlewares) if err != nil { return nil, err } out := result.(*ListAssociatedGroupsOutput) out.ResultMetadata = metadata return out, nil } type ListAssociatedGroupsInput struct { // The ARN of the canary that you want to view groups for. // // This member is required. ResourceArn *string // Specify this parameter to limit how many groups are returned each time you use // the ListAssociatedGroups operation. If you omit this parameter, the default of // 20 is used. MaxResults *int32 // A token that indicates that there is more data available. You can use this // token in a subsequent operation to retrieve the next set of results. NextToken *string noSmithyDocumentSerde } type ListAssociatedGroupsOutput struct { // An array of structures that contain information about the groups that this // canary is associated with. Groups []types.GroupSummary // A token that indicates that there is more data available. You can use this // token in a subsequent ListAssociatedGroups operation to retrieve the next set // of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAssociatedGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssociatedGroups{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssociatedGroups{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAssociatedGroupsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociatedGroups(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAssociatedGroupsAPIClient is a client that implements the // ListAssociatedGroups operation. type ListAssociatedGroupsAPIClient interface { ListAssociatedGroups(context.Context, *ListAssociatedGroupsInput, ...func(*Options)) (*ListAssociatedGroupsOutput, error) } var _ ListAssociatedGroupsAPIClient = (*Client)(nil) // ListAssociatedGroupsPaginatorOptions is the paginator options for // ListAssociatedGroups type ListAssociatedGroupsPaginatorOptions struct { // Specify this parameter to limit how many groups are returned each time you use // the ListAssociatedGroups operation. If you omit this parameter, the default of // 20 is used. 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 } // ListAssociatedGroupsPaginator is a paginator for ListAssociatedGroups type ListAssociatedGroupsPaginator struct { options ListAssociatedGroupsPaginatorOptions client ListAssociatedGroupsAPIClient params *ListAssociatedGroupsInput nextToken *string firstPage bool } // NewListAssociatedGroupsPaginator returns a new ListAssociatedGroupsPaginator func NewListAssociatedGroupsPaginator(client ListAssociatedGroupsAPIClient, params *ListAssociatedGroupsInput, optFns ...func(*ListAssociatedGroupsPaginatorOptions)) *ListAssociatedGroupsPaginator { if params == nil { params = &ListAssociatedGroupsInput{} } options := ListAssociatedGroupsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAssociatedGroupsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAssociatedGroupsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAssociatedGroups page. func (p *ListAssociatedGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedGroupsOutput, 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.ListAssociatedGroups(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_opListAssociatedGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "ListAssociatedGroups", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // This operation returns a list of the ARNs of the canaries that are associated // with the specified group. func (c *Client) ListGroupResources(ctx context.Context, params *ListGroupResourcesInput, optFns ...func(*Options)) (*ListGroupResourcesOutput, error) { if params == nil { params = &ListGroupResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListGroupResources", params, optFns, c.addOperationListGroupResourcesMiddlewares) if err != nil { return nil, err } out := result.(*ListGroupResourcesOutput) out.ResultMetadata = metadata return out, nil } type ListGroupResourcesInput struct { // Specifies the group to return information for. You can specify the group name, // the ARN, or the group ID as the GroupIdentifier . // // This member is required. GroupIdentifier *string // Specify this parameter to limit how many canary ARNs are returned each time you // use the ListGroupResources operation. If you omit this parameter, the default // of 20 is used. MaxResults *int32 // A token that indicates that there is more data available. You can use this // token in a subsequent operation to retrieve the next set of results. NextToken *string noSmithyDocumentSerde } type ListGroupResourcesOutput struct { // A token that indicates that there is more data available. You can use this // token in a subsequent ListGroupResources operation to retrieve the next set of // results. NextToken *string // An array of ARNs. These ARNs are for the canaries that are associated with the // group. Resources []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListGroupResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListGroupResources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListGroupResources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListGroupResourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGroupResources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListGroupResourcesAPIClient is a client that implements the ListGroupResources // operation. type ListGroupResourcesAPIClient interface { ListGroupResources(context.Context, *ListGroupResourcesInput, ...func(*Options)) (*ListGroupResourcesOutput, error) } var _ ListGroupResourcesAPIClient = (*Client)(nil) // ListGroupResourcesPaginatorOptions is the paginator options for // ListGroupResources type ListGroupResourcesPaginatorOptions struct { // Specify this parameter to limit how many canary ARNs are returned each time you // use the ListGroupResources operation. If you omit this parameter, the default // of 20 is used. 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 } // ListGroupResourcesPaginator is a paginator for ListGroupResources type ListGroupResourcesPaginator struct { options ListGroupResourcesPaginatorOptions client ListGroupResourcesAPIClient params *ListGroupResourcesInput nextToken *string firstPage bool } // NewListGroupResourcesPaginator returns a new ListGroupResourcesPaginator func NewListGroupResourcesPaginator(client ListGroupResourcesAPIClient, params *ListGroupResourcesInput, optFns ...func(*ListGroupResourcesPaginatorOptions)) *ListGroupResourcesPaginator { if params == nil { params = &ListGroupResourcesInput{} } options := ListGroupResourcesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListGroupResourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListGroupResourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListGroupResources page. func (p *ListGroupResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupResourcesOutput, 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.ListGroupResources(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_opListGroupResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "ListGroupResources", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all groups in the account, displaying their names, unique // IDs, and ARNs. The groups from all Regions are returned. func (c *Client) ListGroups(ctx context.Context, params *ListGroupsInput, optFns ...func(*Options)) (*ListGroupsOutput, error) { if params == nil { params = &ListGroupsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListGroups", params, optFns, c.addOperationListGroupsMiddlewares) if err != nil { return nil, err } out := result.(*ListGroupsOutput) out.ResultMetadata = metadata return out, nil } type ListGroupsInput struct { // Specify this parameter to limit how many groups are returned each time you use // the ListGroups operation. If you omit this parameter, the default of 20 is used. MaxResults *int32 // A token that indicates that there is more data available. You can use this // token in a subsequent operation to retrieve the next set of results. NextToken *string noSmithyDocumentSerde } type ListGroupsOutput struct { // An array of structures that each contain information about one group. Groups []types.GroupSummary // A token that indicates that there is more data available. You can use this // token in a subsequent ListGroups operation to retrieve the next set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListGroups{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListGroups{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListGroups(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListGroupsAPIClient is a client that implements the ListGroups operation. type ListGroupsAPIClient interface { ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) } var _ ListGroupsAPIClient = (*Client)(nil) // ListGroupsPaginatorOptions is the paginator options for ListGroups type ListGroupsPaginatorOptions struct { // Specify this parameter to limit how many groups are returned each time you use // the ListGroups operation. If you omit this parameter, the default of 20 is used. 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 } // ListGroupsPaginator is a paginator for ListGroups type ListGroupsPaginator struct { options ListGroupsPaginatorOptions client ListGroupsAPIClient params *ListGroupsInput nextToken *string firstPage bool } // NewListGroupsPaginator returns a new ListGroupsPaginator func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { if params == nil { params = &ListGroupsInput{} } options := ListGroupsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListGroupsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListGroupsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListGroups page. func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, 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.ListGroups(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_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "ListGroups", } }
221
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // Displays the tags associated with a canary or group. 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 ARN of the canary or group that you want to view tags for. The ARN format // of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The // ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The list of tag keys and values associated with the resource that you specified. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "ListTagsForResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // Use this operation to run a canary that has already been created. The frequency // of the canary runs is determined by the value of the canary's Schedule . To see // a canary's schedule, use GetCanary (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanary.html) // . func (c *Client) StartCanary(ctx context.Context, params *StartCanaryInput, optFns ...func(*Options)) (*StartCanaryOutput, error) { if params == nil { params = &StartCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "StartCanary", params, optFns, c.addOperationStartCanaryMiddlewares) if err != nil { return nil, err } out := result.(*StartCanaryOutput) out.ResultMetadata = metadata return out, nil } type StartCanaryInput struct { // The name of the canary that you want to run. To find canary names, use // DescribeCanaries (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html) // . // // This member is required. Name *string noSmithyDocumentSerde } type StartCanaryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "StartCanary", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // Stops the canary to prevent all future runs. If the canary is currently // running,the run that is in progress completes on its own, publishes metrics, and // uploads artifacts, but it is not recorded in Synthetics as a completed run. You // can use StartCanary to start it running again with the canary’s current // schedule at any point in the future. func (c *Client) StopCanary(ctx context.Context, params *StopCanaryInput, optFns ...func(*Options)) (*StopCanaryOutput, error) { if params == nil { params = &StopCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "StopCanary", params, optFns, c.addOperationStopCanaryMiddlewares) if err != nil { return nil, err } out := result.(*StopCanaryOutput) out.ResultMetadata = metadata return out, nil } type StopCanaryInput struct { // The name of the canary that you want to stop. To find the names of your // canaries, use ListCanaries (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html) // . // // This member is required. Name *string noSmithyDocumentSerde } type StopCanaryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStopCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "StopCanary", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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" ) // Assigns one or more tags (key-value pairs) to the specified canary or group. // Tags can help you organize and categorize your resources. You can also use them // to scope user permissions, by granting a user permission to access or change // only resources with certain tag values. Tags don't have any semantic meaning to // Amazon Web Services and are interpreted strictly as strings of characters. You // can use the TagResource action with a resource that already has tags. If you // specify a new tag key for the resource, this tag is appended to the list of tags // associated with the resource. If you specify a tag key that is already // associated with the resource, the new tag value that you specify replaces the // previous value for that tag. You can associate as many as 50 tags with a canary // or group. 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 ARN of the canary or group that you're adding tags to. The ARN format of a // canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN // format of a group is arn:aws:synthetics:Region:account-id:group:group-name // // This member is required. ResourceArn *string // The list of key-value pairs to associate with the resource. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "TagResource", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes one or more tags from the specified resource. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The ARN of the canary or group that you're removing tags from. The ARN format // of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The // ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name // // This member is required. ResourceArn *string // The list of tag keys to remove from the 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(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "UntagResource", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the configuration of a canary that has already been created. You can't // use this operation to update the tags of an existing canary. To change the tags // of an existing canary, use TagResource (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_TagResource.html) // . func (c *Client) UpdateCanary(ctx context.Context, params *UpdateCanaryInput, optFns ...func(*Options)) (*UpdateCanaryOutput, error) { if params == nil { params = &UpdateCanaryInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateCanary", params, optFns, c.addOperationUpdateCanaryMiddlewares) if err != nil { return nil, err } out := result.(*UpdateCanaryOutput) out.ResultMetadata = metadata return out, nil } type UpdateCanaryInput struct { // The name of the canary that you want to update. To find the names of your // canaries, use DescribeCanaries (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html) // . You cannot change the name of a canary that has already been created. // // This member is required. Name *string // A structure that contains the configuration for canary artifacts, including the // encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. ArtifactConfig *types.ArtifactConfigInput // The location in Amazon S3 where Synthetics stores artifacts from the test runs // of this canary. Artifacts include the log file, screenshots, and HAR files. The // name of the S3 bucket can't include a period (.). ArtifactS3Location *string // A structure that includes the entry point from which the canary should start // running your script. If the script is stored in an S3 bucket, the bucket name, // key, and version are also included. Code *types.CanaryCodeInput // The ARN of the IAM role to be used to run the canary. This role must already // exist, and must include lambda.amazonaws.com as a principal in the trust // policy. The role must also have the following permissions: // - s3:PutObject // - s3:GetBucketLocation // - s3:ListAllMyBuckets // - cloudwatch:PutMetricData // - logs:CreateLogGroup // - logs:CreateLogStream // - logs:CreateLogStream ExecutionRoleArn *string // The number of days to retain data about failed runs of this canary. FailureRetentionPeriodInDays *int32 // A structure that contains the timeout value that is used for each individual // run of the canary. The environment variables keys and values are not encrypted. // Do not store sensitive information in this field. RunConfig *types.CanaryRunConfigInput // Specifies the runtime version to use for the canary. For a list of valid // runtime versions and for more information about runtime versions, see Canary // Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . RuntimeVersion *string // A structure that contains information about how often the canary is to run, and // when these runs are to stop. Schedule *types.CanaryScheduleInput // The number of days to retain data about successful runs of this canary. SuccessRetentionPeriodInDays *int32 // Defines the screenshots to use as the baseline for comparisons during visual // monitoring comparisons during future runs of this canary. If you omit this // parameter, no changes are made to any baseline screenshots that the canary might // be using already. Visual monitoring is supported only on canaries running the // syn-puppeteer-node-3.2 runtime or later. For more information, see Visual // monitoring (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_SyntheticsLogger_VisualTesting.html) // and Visual monitoring blueprint (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Blueprints_VisualTesting.html) VisualReference *types.VisualReferenceInput // If this canary is to test an endpoint in a VPC, this structure contains // information about the subnet and security groups of the VPC endpoint. For more // information, see Running a Canary in a VPC (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html) // . VpcConfig *types.VpcConfigInput noSmithyDocumentSerde } type UpdateCanaryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateCanaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCanary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCanary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateCanaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCanary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateCanary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "synthetics", OperationName: "UpdateCanary", } }
188
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpAssociateResource struct { } func (*awsRestjson1_deserializeOpAssociateResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorAssociateResource(response, &metadata) } output := &AssociateResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAssociateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCreateCanary struct { } func (*awsRestjson1_deserializeOpCreateCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateCanary(response, &metadata) } output := &CreateCanaryOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateCanaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("RequestEntityTooLargeException", errorCode): return awsRestjson1_deserializeErrorRequestEntityTooLargeException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateCanaryOutput(v **CreateCanaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateCanaryOutput if *v == nil { sv = &CreateCanaryOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Canary": if err := awsRestjson1_deserializeDocumentCanary(&sv.Canary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateGroup struct { } func (*awsRestjson1_deserializeOpCreateGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateGroup(response, &metadata) } output := &CreateGroupOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateGroupOutput if *v == nil { sv = &CreateGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Group": if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteCanary struct { } func (*awsRestjson1_deserializeOpDeleteCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteCanary(response, &metadata) } output := &DeleteCanaryOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteGroup struct { } func (*awsRestjson1_deserializeOpDeleteGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteGroup(response, &metadata) } output := &DeleteGroupOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeCanaries struct { } func (*awsRestjson1_deserializeOpDescribeCanaries) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeCanaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeCanaries(response, &metadata) } output := &DescribeCanariesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeCanariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeCanaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeCanariesOutput(v **DescribeCanariesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeCanariesOutput if *v == nil { sv = &DescribeCanariesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Canaries": if err := awsRestjson1_deserializeDocumentCanaries(&sv.Canaries, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeCanariesLastRun struct { } func (*awsRestjson1_deserializeOpDescribeCanariesLastRun) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeCanariesLastRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeCanariesLastRun(response, &metadata) } output := &DescribeCanariesLastRunOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeCanariesLastRunOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeCanariesLastRun(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeCanariesLastRunOutput(v **DescribeCanariesLastRunOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeCanariesLastRunOutput if *v == nil { sv = &DescribeCanariesLastRunOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CanariesLastRun": if err := awsRestjson1_deserializeDocumentCanariesLastRun(&sv.CanariesLastRun, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeRuntimeVersions struct { } func (*awsRestjson1_deserializeOpDescribeRuntimeVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeRuntimeVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeRuntimeVersions(response, &metadata) } output := &DescribeRuntimeVersionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeRuntimeVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeRuntimeVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeRuntimeVersionsOutput(v **DescribeRuntimeVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeRuntimeVersionsOutput if *v == nil { sv = &DescribeRuntimeVersionsOutput{} } 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 Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "RuntimeVersions": if err := awsRestjson1_deserializeDocumentRuntimeVersionList(&sv.RuntimeVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisassociateResource struct { } func (*awsRestjson1_deserializeOpDisassociateResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDisassociateResource(response, &metadata) } output := &DisassociateResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetCanary struct { } func (*awsRestjson1_deserializeOpGetCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetCanary(response, &metadata) } output := &GetCanaryOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetCanaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCanaryOutput(v **GetCanaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetCanaryOutput if *v == nil { sv = &GetCanaryOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Canary": if err := awsRestjson1_deserializeDocumentCanary(&sv.Canary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetCanaryRuns struct { } func (*awsRestjson1_deserializeOpGetCanaryRuns) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCanaryRuns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetCanaryRuns(response, &metadata) } output := &GetCanaryRunsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetCanaryRunsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetCanaryRuns(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCanaryRunsOutput(v **GetCanaryRunsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetCanaryRunsOutput if *v == nil { sv = &GetCanaryRunsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CanaryRuns": if err := awsRestjson1_deserializeDocumentCanaryRuns(&sv.CanaryRuns, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetGroup struct { } func (*awsRestjson1_deserializeOpGetGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetGroup(response, &metadata) } output := &GetGroupOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetGroupOutput(v **GetGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetGroupOutput if *v == nil { sv = &GetGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Group": if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAssociatedGroups struct { } func (*awsRestjson1_deserializeOpListAssociatedGroups) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAssociatedGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListAssociatedGroups(response, &metadata) } output := &ListAssociatedGroupsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListAssociatedGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListAssociatedGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListAssociatedGroupsOutput(v **ListAssociatedGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAssociatedGroupsOutput if *v == nil { sv = &ListAssociatedGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Groups": if err := awsRestjson1_deserializeDocumentGroupSummaryList(&sv.Groups, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListGroupResources struct { } func (*awsRestjson1_deserializeOpListGroupResources) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListGroupResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListGroupResources(response, &metadata) } output := &ListGroupResourcesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListGroupResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListGroupResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListGroupResourcesOutput(v **ListGroupResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListGroupResourcesOutput if *v == nil { sv = &ListGroupResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Resources": if err := awsRestjson1_deserializeDocumentStringList(&sv.Resources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListGroups struct { } func (*awsRestjson1_deserializeOpListGroups) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListGroups(response, &metadata) } output := &ListGroupsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListGroupsOutput(v **ListGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListGroupsOutput if *v == nil { sv = &ListGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Groups": if err := awsRestjson1_deserializeDocumentGroupSummaryList(&sv.Groups, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartCanary struct { } func (*awsRestjson1_deserializeOpStartCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorStartCanary(response, &metadata) } output := &StartCanaryOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStartCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStopCanary struct { } func (*awsRestjson1_deserializeOpStopCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorStopCanary(response, &metadata) } output := &StopCanaryOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStopCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateCanary struct { } func (*awsRestjson1_deserializeOpUpdateCanary) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateCanary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateCanary(response, &metadata) } output := &UpdateCanaryOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateCanary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("RequestEntityTooLargeException", errorCode): return awsRestjson1_deserializeErrorRequestEntityTooLargeException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalFailureException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorRequestEntityTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.RequestEntityTooLargeException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentRequestEntityTooLargeException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyRequestsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentArtifactConfigOutput(v **types.ArtifactConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ArtifactConfigOutput if *v == nil { sv = &types.ArtifactConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "S3Encryption": if err := awsRestjson1_deserializeDocumentS3EncryptionConfig(&sv.S3Encryption, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBaseScreenshot(v **types.BaseScreenshot, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BaseScreenshot if *v == nil { sv = &types.BaseScreenshot{} } else { sv = *v } for key, value := range shape { switch key { case "IgnoreCoordinates": if err := awsRestjson1_deserializeDocumentBaseScreenshotIgnoreCoordinates(&sv.IgnoreCoordinates, value); err != nil { return err } case "ScreenshotName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScreenshotName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBaseScreenshotIgnoreCoordinates(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 BaseScreenshotConfigIgnoreCoordinate to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBaseScreenshots(v *[]types.BaseScreenshot, 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.BaseScreenshot if *v == nil { cv = []types.BaseScreenshot{} } else { cv = *v } for _, value := range shape { var col types.BaseScreenshot destAddr := &col if err := awsRestjson1_deserializeDocumentBaseScreenshot(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCanaries(v *[]types.Canary, 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.Canary if *v == nil { cv = []types.Canary{} } else { cv = *v } for _, value := range shape { var col types.Canary destAddr := &col if err := awsRestjson1_deserializeDocumentCanary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCanariesLastRun(v *[]types.CanaryLastRun, 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.CanaryLastRun if *v == nil { cv = []types.CanaryLastRun{} } else { cv = *v } for _, value := range shape { var col types.CanaryLastRun destAddr := &col if err := awsRestjson1_deserializeDocumentCanaryLastRun(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCanary(v **types.Canary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Canary if *v == nil { sv = &types.Canary{} } else { sv = *v } for key, value := range shape { switch key { case "ArtifactConfig": if err := awsRestjson1_deserializeDocumentArtifactConfigOutput(&sv.ArtifactConfig, value); err != nil { return err } case "ArtifactS3Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ArtifactS3Location = ptr.String(jtv) } case "Code": if err := awsRestjson1_deserializeDocumentCanaryCodeOutput(&sv.Code, value); err != nil { return err } case "EngineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionArn to be of type string, got %T instead", value) } sv.EngineArn = ptr.String(jtv) } case "ExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } case "FailureRetentionPeriodInDays": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxSize1024 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.FailureRetentionPeriodInDays = ptr.Int32(int32(i64)) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UUID to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RunConfig": if err := awsRestjson1_deserializeDocumentCanaryRunConfigOutput(&sv.RunConfig, value); err != nil { return err } case "RuntimeVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RuntimeVersion = ptr.String(jtv) } case "Schedule": if err := awsRestjson1_deserializeDocumentCanaryScheduleOutput(&sv.Schedule, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentCanaryStatus(&sv.Status, value); err != nil { return err } case "SuccessRetentionPeriodInDays": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxSize1024 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SuccessRetentionPeriodInDays = ptr.Int32(int32(i64)) } case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "Timeline": if err := awsRestjson1_deserializeDocumentCanaryTimeline(&sv.Timeline, value); err != nil { return err } case "VisualReference": if err := awsRestjson1_deserializeDocumentVisualReferenceOutput(&sv.VisualReference, value); err != nil { return err } case "VpcConfig": if err := awsRestjson1_deserializeDocumentVpcConfigOutput(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryCodeOutput(v **types.CanaryCodeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryCodeOutput if *v == nil { sv = &types.CanaryCodeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handler": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Handler = ptr.String(jtv) } case "SourceLocationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SourceLocationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryLastRun(v **types.CanaryLastRun, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryLastRun if *v == nil { sv = &types.CanaryLastRun{} } else { sv = *v } for key, value := range shape { switch key { case "CanaryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryName to be of type string, got %T instead", value) } sv.CanaryName = ptr.String(jtv) } case "LastRun": if err := awsRestjson1_deserializeDocumentCanaryRun(&sv.LastRun, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryRun(v **types.CanaryRun, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryRun if *v == nil { sv = &types.CanaryRun{} } else { sv = *v } for key, value := range shape { switch key { case "ArtifactS3Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ArtifactS3Location = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UUID to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if err := awsRestjson1_deserializeDocumentCanaryRunStatus(&sv.Status, value); err != nil { return err } case "Timeline": if err := awsRestjson1_deserializeDocumentCanaryRunTimeline(&sv.Timeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryRunConfigOutput(v **types.CanaryRunConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryRunConfigOutput if *v == nil { sv = &types.CanaryRunConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveTracing": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.ActiveTracing = ptr.Bool(jtv) } case "MemoryInMB": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxSize3008 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MemoryInMB = ptr.Int32(int32(i64)) } case "TimeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxFifteenMinutesInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryRuns(v *[]types.CanaryRun, 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.CanaryRun if *v == nil { cv = []types.CanaryRun{} } else { cv = *v } for _, value := range shape { var col types.CanaryRun destAddr := &col if err := awsRestjson1_deserializeDocumentCanaryRun(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCanaryRunStatus(v **types.CanaryRunStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryRunStatus if *v == nil { sv = &types.CanaryRunStatus{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryRunState to be of type string, got %T instead", value) } sv.State = types.CanaryRunState(jtv) } case "StateReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StateReason = ptr.String(jtv) } case "StateReasonCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryRunStateReasonCode to be of type string, got %T instead", value) } sv.StateReasonCode = types.CanaryRunStateReasonCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryRunTimeline(v **types.CanaryRunTimeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryRunTimeline if *v == nil { sv = &types.CanaryRunTimeline{} } else { sv = *v } for key, value := range shape { switch key { case "Completed": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Completed = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Started": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Started = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryScheduleOutput(v **types.CanaryScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryScheduleOutput if *v == nil { sv = &types.CanaryScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxOneYearInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int64(i64) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryStatus(v **types.CanaryStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryStatus if *v == nil { sv = &types.CanaryStatus{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryState to be of type string, got %T instead", value) } sv.State = types.CanaryState(jtv) } case "StateReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StateReason = ptr.String(jtv) } case "StateReasonCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanaryStateReasonCode to be of type string, got %T instead", value) } sv.StateReasonCode = types.CanaryStateReasonCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCanaryTimeline(v **types.CanaryTimeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CanaryTimeline if *v == nil { sv = &types.CanaryTimeline{} } else { sv = *v } for key, value := range shape { switch key { case "Created": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Created = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastModified": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastStarted": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStarted = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastStopped": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStopped = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroup(v **types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Group if *v == nil { sv = &types.Group{} } 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 GroupArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroupSummary(v **types.GroupSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.GroupSummary if *v == nil { sv = &types.GroupSummary{} } 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 GroupArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroupSummaryList(v *[]types.GroupSummary, 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.GroupSummary if *v == nil { cv = []types.GroupSummary{} } else { cv = *v } for _, value := range shape { var col types.GroupSummary destAddr := &col if err := awsRestjson1_deserializeDocumentGroupSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalFailureException if *v == nil { sv = &types.InternalFailureException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRequestEntityTooLargeException(v **types.RequestEntityTooLargeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RequestEntityTooLargeException if *v == nil { sv = &types.RequestEntityTooLargeException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuntimeVersion(v **types.RuntimeVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuntimeVersion if *v == nil { sv = &types.RuntimeVersion{} } else { sv = *v } for key, value := range shape { switch key { case "DeprecationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeprecationDate = 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 String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "ReleaseDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ReleaseDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "VersionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VersionName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuntimeVersionList(v *[]types.RuntimeVersion, 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.RuntimeVersion if *v == nil { cv = []types.RuntimeVersion{} } else { cv = *v } for _, value := range shape { var col types.RuntimeVersion destAddr := &col if err := awsRestjson1_deserializeDocumentRuntimeVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentS3EncryptionConfig(v **types.S3EncryptionConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3EncryptionConfig if *v == nil { sv = &types.S3EncryptionConfig{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EncryptionMode to be of type string, got %T instead", value) } sv.EncryptionMode = types.EncryptionMode(jtv) } case "KmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnetIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualReferenceOutput(v **types.VisualReferenceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VisualReferenceOutput if *v == nil { sv = &types.VisualReferenceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BaseCanaryRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.BaseCanaryRunId = ptr.String(jtv) } case "BaseScreenshots": if err := awsRestjson1_deserializeDocumentBaseScreenshots(&sv.BaseScreenshots, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConfigOutput(v **types.VpcConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VpcConfigOutput if *v == nil { sv = &types.VpcConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { return err } 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 }
5,074
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package synthetics provides the API client, operations, and parameter types for // Synthetics. // // Amazon CloudWatch Synthetics You can use Amazon CloudWatch Synthetics to // continually monitor your services. You can create and manage canaries, which are // modular, lightweight scripts that monitor your endpoints and APIs from the // outside-in. You can set up your canaries to run 24 hours a day, once per minute. // The canaries help you check the availability and latency of your web services // and troubleshoot anomalies by investigating load time data, screenshots of the // UI, logs, and metrics. The canaries seamlessly integrate with CloudWatch // ServiceLens to help you trace the causes of impacted nodes in your applications. // For more information, see Using ServiceLens to Monitor the Health of Your // Applications (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html) // in the Amazon CloudWatch User Guide. Before you create and manage canaries, be // aware of the security considerations. For more information, see Security // Considerations for Synthetics Canaries (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html) // . package synthetics
21
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics 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/synthetics/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 = "synthetics" } 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 synthetics // goModuleVersion is the tagged release for this module const goModuleVersion = "1.17.13"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpAssociateResource struct { } func (*awsRestjson1_serializeOpAssociateResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group/{GroupIdentifier}/associate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsAssociateResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateResourceInput(v *AssociateResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.GroupIdentifier == nil || len(*v.GroupIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member GroupIdentifier must not be empty")} } if v.GroupIdentifier != nil { if err := encoder.SetURI("GroupIdentifier").String(*v.GroupIdentifier); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentAssociateResourceInput(v *AssociateResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpCreateCanary struct { } func (*awsRestjson1_serializeOpCreateCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateCanaryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateCanaryInput(v *CreateCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateCanaryInput(v *CreateCanaryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ArtifactConfig != nil { ok := object.Key("ArtifactConfig") if err := awsRestjson1_serializeDocumentArtifactConfigInput(v.ArtifactConfig, ok); err != nil { return err } } if v.ArtifactS3Location != nil { ok := object.Key("ArtifactS3Location") ok.String(*v.ArtifactS3Location) } if v.Code != nil { ok := object.Key("Code") if err := awsRestjson1_serializeDocumentCanaryCodeInput(v.Code, ok); err != nil { return err } } if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) } if v.FailureRetentionPeriodInDays != nil { ok := object.Key("FailureRetentionPeriodInDays") ok.Integer(*v.FailureRetentionPeriodInDays) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.RunConfig != nil { ok := object.Key("RunConfig") if err := awsRestjson1_serializeDocumentCanaryRunConfigInput(v.RunConfig, ok); err != nil { return err } } if v.RuntimeVersion != nil { ok := object.Key("RuntimeVersion") ok.String(*v.RuntimeVersion) } if v.Schedule != nil { ok := object.Key("Schedule") if err := awsRestjson1_serializeDocumentCanaryScheduleInput(v.Schedule, ok); err != nil { return err } } if v.SuccessRetentionPeriodInDays != nil { ok := object.Key("SuccessRetentionPeriodInDays") ok.Integer(*v.SuccessRetentionPeriodInDays) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.VpcConfig != nil { ok := object.Key("VpcConfig") if err := awsRestjson1_serializeDocumentVpcConfigInput(v.VpcConfig, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateGroup struct { } func (*awsRestjson1_serializeOpCreateGroup) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateGroupInput(v *CreateGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateGroupInput(v *CreateGroupInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteCanary struct { } func (*awsRestjson1_serializeOpDeleteCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteCanaryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteCanaryInput(v *DeleteCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DeleteLambda { encoder.SetQuery("deleteLambda").Boolean(v.DeleteLambda) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteGroup struct { } func (*awsRestjson1_serializeOpDeleteGroup) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group/{GroupIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteGroupInput(v *DeleteGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.GroupIdentifier == nil || len(*v.GroupIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member GroupIdentifier must not be empty")} } if v.GroupIdentifier != nil { if err := encoder.SetURI("GroupIdentifier").String(*v.GroupIdentifier); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeCanaries struct { } func (*awsRestjson1_serializeOpDescribeCanaries) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeCanaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeCanariesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canaries") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeCanariesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeCanariesInput(v *DescribeCanariesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeCanariesInput(v *DescribeCanariesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.Names != nil { ok := object.Key("Names") if err := awsRestjson1_serializeDocumentDescribeCanariesNameFilter(v.Names, ok); err != nil { return err } } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeCanariesLastRun struct { } func (*awsRestjson1_serializeOpDescribeCanariesLastRun) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeCanariesLastRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeCanariesLastRunInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canaries/last-run") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeCanariesLastRunInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeCanariesLastRunInput(v *DescribeCanariesLastRunInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeCanariesLastRunInput(v *DescribeCanariesLastRunInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.Names != nil { ok := object.Key("Names") if err := awsRestjson1_serializeDocumentDescribeCanariesLastRunNameFilter(v.Names, ok); err != nil { return err } } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeRuntimeVersions struct { } func (*awsRestjson1_serializeOpDescribeRuntimeVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeRuntimeVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeRuntimeVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/runtime-versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeRuntimeVersionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeRuntimeVersionsInput(v *DescribeRuntimeVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeRuntimeVersionsInput(v *DescribeRuntimeVersionsInput, 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 } type awsRestjson1_serializeOpDisassociateResource struct { } func (*awsRestjson1_serializeOpDisassociateResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group/{GroupIdentifier}/disassociate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDisassociateResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateResourceInput(v *DisassociateResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.GroupIdentifier == nil || len(*v.GroupIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member GroupIdentifier must not be empty")} } if v.GroupIdentifier != nil { if err := encoder.SetURI("GroupIdentifier").String(*v.GroupIdentifier); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentDisassociateResourceInput(v *DisassociateResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpGetCanary struct { } func (*awsRestjson1_serializeOpGetCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetCanaryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetCanaryInput(v *GetCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetCanaryRuns struct { } func (*awsRestjson1_serializeOpGetCanaryRuns) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCanaryRuns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetCanaryRunsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}/runs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetCanaryRunsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetCanaryRunsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetCanaryRunsInput(v *GetCanaryRunsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentGetCanaryRunsInput(v *GetCanaryRunsInput, 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 } type awsRestjson1_serializeOpGetGroup struct { } func (*awsRestjson1_serializeOpGetGroup) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group/{GroupIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetGroupInput(v *GetGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.GroupIdentifier == nil || len(*v.GroupIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member GroupIdentifier must not be empty")} } if v.GroupIdentifier != nil { if err := encoder.SetURI("GroupIdentifier").String(*v.GroupIdentifier); err != nil { return err } } return nil } type awsRestjson1_serializeOpListAssociatedGroups struct { } func (*awsRestjson1_serializeOpListAssociatedGroups) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListAssociatedGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAssociatedGroupsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource/{ResourceArn}/groups") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListAssociatedGroupsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListAssociatedGroupsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListAssociatedGroupsInput(v *ListAssociatedGroupsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentListAssociatedGroupsInput(v *ListAssociatedGroupsInput, 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 } type awsRestjson1_serializeOpListGroupResources struct { } func (*awsRestjson1_serializeOpListGroupResources) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListGroupResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListGroupResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/group/{GroupIdentifier}/resources") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListGroupResourcesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListGroupResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListGroupResourcesInput(v *ListGroupResourcesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.GroupIdentifier == nil || len(*v.GroupIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member GroupIdentifier must not be empty")} } if v.GroupIdentifier != nil { if err := encoder.SetURI("GroupIdentifier").String(*v.GroupIdentifier); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentListGroupResourcesInput(v *ListGroupResourcesInput, 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 } type awsRestjson1_serializeOpListGroups struct { } func (*awsRestjson1_serializeOpListGroups) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListGroupsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/groups") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListGroupsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListGroupsInput(v *ListGroupsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListGroupsInput(v *ListGroupsInput, 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 } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartCanary struct { } func (*awsRestjson1_serializeOpStartCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}/start") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStartCanaryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartCanaryInput(v *StartCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpStopCanary struct { } func (*awsRestjson1_serializeOpStopCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}/stop") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStopCanaryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStopCanaryInput(v *StopCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateCanary struct { } func (*awsRestjson1_serializeOpUpdateCanary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateCanary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateCanaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/canary/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateCanaryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateCanaryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateCanaryInput(v *UpdateCanaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateCanaryInput(v *UpdateCanaryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ArtifactConfig != nil { ok := object.Key("ArtifactConfig") if err := awsRestjson1_serializeDocumentArtifactConfigInput(v.ArtifactConfig, ok); err != nil { return err } } if v.ArtifactS3Location != nil { ok := object.Key("ArtifactS3Location") ok.String(*v.ArtifactS3Location) } if v.Code != nil { ok := object.Key("Code") if err := awsRestjson1_serializeDocumentCanaryCodeInput(v.Code, ok); err != nil { return err } } if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) } if v.FailureRetentionPeriodInDays != nil { ok := object.Key("FailureRetentionPeriodInDays") ok.Integer(*v.FailureRetentionPeriodInDays) } if v.RunConfig != nil { ok := object.Key("RunConfig") if err := awsRestjson1_serializeDocumentCanaryRunConfigInput(v.RunConfig, ok); err != nil { return err } } if v.RuntimeVersion != nil { ok := object.Key("RuntimeVersion") ok.String(*v.RuntimeVersion) } if v.Schedule != nil { ok := object.Key("Schedule") if err := awsRestjson1_serializeDocumentCanaryScheduleInput(v.Schedule, ok); err != nil { return err } } if v.SuccessRetentionPeriodInDays != nil { ok := object.Key("SuccessRetentionPeriodInDays") ok.Integer(*v.SuccessRetentionPeriodInDays) } if v.VisualReference != nil { ok := object.Key("VisualReference") if err := awsRestjson1_serializeDocumentVisualReferenceInput(v.VisualReference, ok); err != nil { return err } } if v.VpcConfig != nil { ok := object.Key("VpcConfig") if err := awsRestjson1_serializeDocumentVpcConfigInput(v.VpcConfig, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentArtifactConfigInput(v *types.ArtifactConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Encryption != nil { ok := object.Key("S3Encryption") if err := awsRestjson1_serializeDocumentS3EncryptionConfig(v.S3Encryption, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentBaseScreenshot(v *types.BaseScreenshot, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IgnoreCoordinates != nil { ok := object.Key("IgnoreCoordinates") if err := awsRestjson1_serializeDocumentBaseScreenshotIgnoreCoordinates(v.IgnoreCoordinates, ok); err != nil { return err } } if v.ScreenshotName != nil { ok := object.Key("ScreenshotName") ok.String(*v.ScreenshotName) } return nil } func awsRestjson1_serializeDocumentBaseScreenshotIgnoreCoordinates(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentBaseScreenshots(v []types.BaseScreenshot, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentBaseScreenshot(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCanaryCodeInput(v *types.CanaryCodeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Handler != nil { ok := object.Key("Handler") ok.String(*v.Handler) } if v.S3Bucket != nil { ok := object.Key("S3Bucket") ok.String(*v.S3Bucket) } if v.S3Key != nil { ok := object.Key("S3Key") ok.String(*v.S3Key) } if v.S3Version != nil { ok := object.Key("S3Version") ok.String(*v.S3Version) } if v.ZipFile != nil { ok := object.Key("ZipFile") ok.Base64EncodeBytes(v.ZipFile) } return nil } func awsRestjson1_serializeDocumentCanaryRunConfigInput(v *types.CanaryRunConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActiveTracing != nil { ok := object.Key("ActiveTracing") ok.Boolean(*v.ActiveTracing) } if v.EnvironmentVariables != nil { ok := object.Key("EnvironmentVariables") if err := awsRestjson1_serializeDocumentEnvironmentVariablesMap(v.EnvironmentVariables, ok); err != nil { return err } } if v.MemoryInMB != nil { ok := object.Key("MemoryInMB") ok.Integer(*v.MemoryInMB) } if v.TimeoutInSeconds != nil { ok := object.Key("TimeoutInSeconds") ok.Integer(*v.TimeoutInSeconds) } return nil } func awsRestjson1_serializeDocumentCanaryScheduleInput(v *types.CanaryScheduleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DurationInSeconds != nil { ok := object.Key("DurationInSeconds") ok.Long(*v.DurationInSeconds) } if v.Expression != nil { ok := object.Key("Expression") ok.String(*v.Expression) } return nil } func awsRestjson1_serializeDocumentDescribeCanariesLastRunNameFilter(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentDescribeCanariesNameFilter(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentEnvironmentVariablesMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentS3EncryptionConfig(v *types.S3EncryptionConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.EncryptionMode) > 0 { ok := object.Key("EncryptionMode") ok.String(string(v.EncryptionMode)) } if v.KmsKeyArn != nil { ok := object.Key("KmsKeyArn") ok.String(*v.KmsKeyArn) } return nil } func awsRestjson1_serializeDocumentSecurityGroupIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentSubnetIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentVisualReferenceInput(v *types.VisualReferenceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BaseCanaryRunId != nil { ok := object.Key("BaseCanaryRunId") ok.String(*v.BaseCanaryRunId) } if v.BaseScreenshots != nil { ok := object.Key("BaseScreenshots") if err := awsRestjson1_serializeDocumentBaseScreenshots(v.BaseScreenshots, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcConfigInput(v *types.VpcConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("SubnetIds") if err := awsRestjson1_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil { return err } } return nil }
1,910
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package synthetics import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAssociateResource struct { } func (*validateOpAssociateResource) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateCanary struct { } func (*validateOpCreateCanary) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateGroup struct { } func (*validateOpCreateGroup) ID() string { return "OperationInputValidation" } func (m *validateOpCreateGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateGroupInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateGroupInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCanary struct { } func (*validateOpDeleteCanary) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteGroup struct { } func (*validateOpDeleteGroup) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteGroupInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteGroupInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateResource struct { } func (*validateOpDisassociateResource) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetCanary struct { } func (*validateOpGetCanary) ID() string { return "OperationInputValidation" } func (m *validateOpGetCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetCanaryRuns struct { } func (*validateOpGetCanaryRuns) ID() string { return "OperationInputValidation" } func (m *validateOpGetCanaryRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetCanaryRunsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetCanaryRunsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetGroup struct { } func (*validateOpGetGroup) ID() string { return "OperationInputValidation" } func (m *validateOpGetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetGroupInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetGroupInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAssociatedGroups struct { } func (*validateOpListAssociatedGroups) ID() string { return "OperationInputValidation" } func (m *validateOpListAssociatedGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAssociatedGroupsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAssociatedGroupsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListGroupResources struct { } func (*validateOpListGroupResources) ID() string { return "OperationInputValidation" } func (m *validateOpListGroupResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListGroupResourcesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListGroupResourcesInput(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 validateOpStartCanary struct { } func (*validateOpStartCanary) ID() string { return "OperationInputValidation" } func (m *validateOpStartCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopCanary struct { } func (*validateOpStopCanary) ID() string { return "OperationInputValidation" } func (m *validateOpStopCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateCanary struct { } func (*validateOpUpdateCanary) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateCanary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateCanaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateCanaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAssociateResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateResource{}, middleware.After) } func addOpCreateCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCanary{}, middleware.After) } func addOpCreateGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGroup{}, middleware.After) } func addOpDeleteCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCanary{}, middleware.After) } func addOpDeleteGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteGroup{}, middleware.After) } func addOpDisassociateResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateResource{}, middleware.After) } func addOpGetCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCanary{}, middleware.After) } func addOpGetCanaryRunsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCanaryRuns{}, middleware.After) } func addOpGetGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetGroup{}, middleware.After) } func addOpListAssociatedGroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssociatedGroups{}, middleware.After) } func addOpListGroupResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListGroupResources{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartCanary{}, middleware.After) } func addOpStopCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopCanary{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateCanaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCanary{}, middleware.After) } func validateBaseScreenshot(v *types.BaseScreenshot) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BaseScreenshot"} if v.ScreenshotName == nil { invalidParams.Add(smithy.NewErrParamRequired("ScreenshotName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateBaseScreenshots(v []types.BaseScreenshot) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BaseScreenshots"} for i := range v { if err := validateBaseScreenshot(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCanaryCodeInput(v *types.CanaryCodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CanaryCodeInput"} if v.Handler == nil { invalidParams.Add(smithy.NewErrParamRequired("Handler")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCanaryScheduleInput(v *types.CanaryScheduleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CanaryScheduleInput"} if v.Expression == nil { invalidParams.Add(smithy.NewErrParamRequired("Expression")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVisualReferenceInput(v *types.VisualReferenceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VisualReferenceInput"} if v.BaseScreenshots != nil { if err := validateBaseScreenshots(v.BaseScreenshots); err != nil { invalidParams.AddNested("BaseScreenshots", err.(smithy.InvalidParamsError)) } } if v.BaseCanaryRunId == nil { invalidParams.Add(smithy.NewErrParamRequired("BaseCanaryRunId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateResourceInput(v *AssociateResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateResourceInput"} if v.GroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("GroupIdentifier")) } if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateCanaryInput(v *CreateCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Code == nil { invalidParams.Add(smithy.NewErrParamRequired("Code")) } else if v.Code != nil { if err := validateCanaryCodeInput(v.Code); err != nil { invalidParams.AddNested("Code", err.(smithy.InvalidParamsError)) } } if v.ArtifactS3Location == nil { invalidParams.Add(smithy.NewErrParamRequired("ArtifactS3Location")) } if v.ExecutionRoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn")) } if v.Schedule == nil { invalidParams.Add(smithy.NewErrParamRequired("Schedule")) } else if v.Schedule != nil { if err := validateCanaryScheduleInput(v.Schedule); err != nil { invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) } } if v.RuntimeVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("RuntimeVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateGroupInput(v *CreateGroupInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateGroupInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCanaryInput(v *DeleteCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteGroupInput(v *DeleteGroupInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteGroupInput"} if v.GroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("GroupIdentifier")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateResourceInput(v *DisassociateResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateResourceInput"} if v.GroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("GroupIdentifier")) } if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetCanaryInput(v *GetCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetCanaryRunsInput(v *GetCanaryRunsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetCanaryRunsInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetGroupInput(v *GetGroupInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetGroupInput"} if v.GroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("GroupIdentifier")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAssociatedGroupsInput(v *ListAssociatedGroupsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAssociatedGroupsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListGroupResourcesInput(v *ListGroupResourcesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListGroupResourcesInput"} if v.GroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("GroupIdentifier")) } 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 validateOpStartCanaryInput(v *StartCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopCanaryInput(v *StopCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateCanaryInput(v *UpdateCanaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateCanaryInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Code != nil { if err := validateCanaryCodeInput(v.Code); err != nil { invalidParams.AddNested("Code", err.(smithy.InvalidParamsError)) } } if v.Schedule != nil { if err := validateCanaryScheduleInput(v.Schedule); err != nil { invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) } } if v.VisualReference != nil { if err := validateVisualReferenceInput(v.VisualReference); err != nil { invalidParams.AddNested("VisualReference", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
807
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 synthetics 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: "synthetics.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "synthetics-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "synthetics-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: "synthetics-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: "synthetics-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: "synthetics-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: "synthetics-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "synthetics.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "synthetics-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{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: "synthetics-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{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{}, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{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: "synthetics-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{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: "synthetics.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "synthetics-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "synthetics-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "synthetics.{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: "synthetics-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: "synthetics-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: "synthetics-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: "synthetics-fips.us-gov-west-1.amazonaws.com", }, }, }, }
499
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 CanaryRunState string // Enum values for CanaryRunState const ( CanaryRunStateRunning CanaryRunState = "RUNNING" CanaryRunStatePassed CanaryRunState = "PASSED" CanaryRunStateFailed CanaryRunState = "FAILED" ) // Values returns all known values for CanaryRunState. 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 (CanaryRunState) Values() []CanaryRunState { return []CanaryRunState{ "RUNNING", "PASSED", "FAILED", } } type CanaryRunStateReasonCode string // Enum values for CanaryRunStateReasonCode const ( CanaryRunStateReasonCodeCanaryFailure CanaryRunStateReasonCode = "CANARY_FAILURE" CanaryRunStateReasonCodeExecutionFailure CanaryRunStateReasonCode = "EXECUTION_FAILURE" ) // Values returns all known values for CanaryRunStateReasonCode. 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 (CanaryRunStateReasonCode) Values() []CanaryRunStateReasonCode { return []CanaryRunStateReasonCode{ "CANARY_FAILURE", "EXECUTION_FAILURE", } } type CanaryState string // Enum values for CanaryState const ( CanaryStateCreating CanaryState = "CREATING" CanaryStateReady CanaryState = "READY" CanaryStateStarting CanaryState = "STARTING" CanaryStateRunning CanaryState = "RUNNING" CanaryStateUpdating CanaryState = "UPDATING" CanaryStateStopping CanaryState = "STOPPING" CanaryStateStopped CanaryState = "STOPPED" CanaryStateError CanaryState = "ERROR" CanaryStateDeleting CanaryState = "DELETING" ) // Values returns all known values for CanaryState. 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 (CanaryState) Values() []CanaryState { return []CanaryState{ "CREATING", "READY", "STARTING", "RUNNING", "UPDATING", "STOPPING", "STOPPED", "ERROR", "DELETING", } } type CanaryStateReasonCode string // Enum values for CanaryStateReasonCode const ( CanaryStateReasonCodeInvalidPermissions CanaryStateReasonCode = "INVALID_PERMISSIONS" CanaryStateReasonCodeCreatePending CanaryStateReasonCode = "CREATE_PENDING" CanaryStateReasonCodeCreateInProgress CanaryStateReasonCode = "CREATE_IN_PROGRESS" CanaryStateReasonCodeCreateFailed CanaryStateReasonCode = "CREATE_FAILED" CanaryStateReasonCodeUpdatePending CanaryStateReasonCode = "UPDATE_PENDING" CanaryStateReasonCodeUpdateInProgress CanaryStateReasonCode = "UPDATE_IN_PROGRESS" CanaryStateReasonCodeUpdateComplete CanaryStateReasonCode = "UPDATE_COMPLETE" CanaryStateReasonCodeRollbackComplete CanaryStateReasonCode = "ROLLBACK_COMPLETE" CanaryStateReasonCodeRollbackFailed CanaryStateReasonCode = "ROLLBACK_FAILED" CanaryStateReasonCodeDeleteInProgress CanaryStateReasonCode = "DELETE_IN_PROGRESS" CanaryStateReasonCodeDeleteFailed CanaryStateReasonCode = "DELETE_FAILED" CanaryStateReasonCodeSyncDeleteInProgress CanaryStateReasonCode = "SYNC_DELETE_IN_PROGRESS" ) // Values returns all known values for CanaryStateReasonCode. 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 (CanaryStateReasonCode) Values() []CanaryStateReasonCode { return []CanaryStateReasonCode{ "INVALID_PERMISSIONS", "CREATE_PENDING", "CREATE_IN_PROGRESS", "CREATE_FAILED", "UPDATE_PENDING", "UPDATE_IN_PROGRESS", "UPDATE_COMPLETE", "ROLLBACK_COMPLETE", "ROLLBACK_FAILED", "DELETE_IN_PROGRESS", "DELETE_FAILED", "SYNC_DELETE_IN_PROGRESS", } } type EncryptionMode string // Enum values for EncryptionMode const ( EncryptionModeSseS3 EncryptionMode = "SSE_S3" EncryptionModeSseKms EncryptionMode = "SSE_KMS" ) // Values returns all known values for EncryptionMode. 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 (EncryptionMode) Values() []EncryptionMode { return []EncryptionMode{ "SSE_S3", "SSE_KMS", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // The request was not valid. type BadRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BadRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadRequestException" } return *e.ErrorCodeOverride } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A conflicting operation is already in progress. 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 } // An internal failure occurred. Try the operation again. type InternalFailureException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalFailureException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalFailureException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalFailureException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalFailureException" } return *e.ErrorCodeOverride } func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // An unknown internal error occurred. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The specified resource was not found. type NotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NotFoundException" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // One of the input resources is larger than is allowed. type RequestEntityTooLargeException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *RequestEntityTooLargeException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *RequestEntityTooLargeException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *RequestEntityTooLargeException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "RequestEntityTooLargeException" } return *e.ErrorCodeOverride } func (e *RequestEntityTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // One of the specified resources was not found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request exceeded a service quota value. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // There were too many simultaneous requests. Try the operation 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 } // A parameter could not be validated. type ValidationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
269
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // A structure that contains the configuration for canary artifacts, including the // encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. type ArtifactConfigInput struct { // A structure that contains the configuration of the encryption-at-rest settings // for artifacts that the canary uploads to Amazon S3. Artifact encryption // functionality is available only for canaries that use Synthetics runtime version // syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary // artifacts (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_artifact_encryption.html) S3Encryption *S3EncryptionConfig noSmithyDocumentSerde } // A structure that contains the configuration for canary artifacts, including the // encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. type ArtifactConfigOutput struct { // A structure that contains the configuration of encryption settings for canary // artifacts that are stored in Amazon S3. S3Encryption *S3EncryptionConfig noSmithyDocumentSerde } // A structure representing a screenshot that is used as a baseline during visual // monitoring comparisons made by the canary. type BaseScreenshot struct { // The name of the screenshot. This is generated the first time the canary is run // after the UpdateCanary operation that specified for this canary to perform // visual monitoring. // // This member is required. ScreenshotName *string // Coordinates that define the part of a screen to ignore during screenshot // comparisons. To obtain the coordinates to use here, use the CloudWatch console // to draw the boundaries on the screen. For more information, see Editing or // deleting a canary (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/synthetics_canaries_deletion.html) IgnoreCoordinates []string noSmithyDocumentSerde } // This structure contains all information about one canary in your account. type Canary struct { // A structure that contains the configuration for canary artifacts, including the // encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. ArtifactConfig *ArtifactConfigOutput // The location in Amazon S3 where Synthetics stores artifacts from the runs of // this canary. Artifacts include the log file, screenshots, and HAR files. ArtifactS3Location *string // This structure contains information about the canary's Lambda handler and where // its code is stored by CloudWatch Synthetics. Code *CanaryCodeOutput // The ARN of the Lambda function that is used as your canary's engine. For more // information about Lambda ARN format, see Resources and Conditions for Lambda // Actions (https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html) // . EngineArn *string // The ARN of the IAM role used to run the canary. This role must include // lambda.amazonaws.com as a principal in the trust policy. ExecutionRoleArn *string // The number of days to retain data about failed runs of this canary. FailureRetentionPeriodInDays *int32 // The unique ID of this canary. Id *string // The name of the canary. Name *string // A structure that contains information about a canary run. RunConfig *CanaryRunConfigOutput // Specifies the runtime version to use for the canary. For more information about // runtime versions, see Canary Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . RuntimeVersion *string // A structure that contains information about how often the canary is to run, and // when these runs are to stop. Schedule *CanaryScheduleOutput // A structure that contains information about the canary's status. Status *CanaryStatus // The number of days to retain data about successful runs of this canary. SuccessRetentionPeriodInDays *int32 // The list of key-value pairs that are associated with the canary. Tags map[string]string // A structure that contains information about when the canary was created, // modified, and most recently run. Timeline *CanaryTimeline // If this canary performs visual monitoring by comparing screenshots, this // structure contains the ID of the canary run to use as the baseline for // screenshots, and the coordinates of any parts of the screen to ignore during the // visual monitoring comparison. VisualReference *VisualReferenceOutput // If this canary is to test an endpoint in a VPC, this structure contains // information about the subnets and security groups of the VPC endpoint. For more // information, see Running a Canary in a VPC (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html) // . VpcConfig *VpcConfigOutput noSmithyDocumentSerde } // Use this structure to input your script code for the canary. This structure // contains the Lambda handler with the location where the canary should start // running the script. If the script is stored in an S3 bucket, the bucket name, // key, and version are also included. If the script was passed into the canary // directly, the script code is contained in the value of Zipfile . type CanaryCodeInput struct { // The entry point to use for the source code when running the canary. For // canaries that use the syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer // runtime earlier than syn-nodejs.puppeteer-3.4 , the handler must be specified as // fileName.handler . For syn-python-selenium-1.1 , syn-nodejs.puppeteer-3.4 , and // later runtimes, the handler can be specified as fileName.functionName , or you // can specify a folder where canary scripts reside as // folder/fileName.functionName . // // This member is required. Handler *string // If your canary script is located in S3, specify the bucket name here. Do not // include s3:// as the start of the bucket name. S3Bucket *string // The S3 key of your script. For more information, see Working with Amazon S3 // Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingObjects.html) . S3Key *string // The S3 version ID of your script. S3Version *string // If you input your canary script directly into the canary instead of referring // to an S3 location, the value of this parameter is the base64-encoded contents of // the .zip file that contains the script. It must be smaller than 225 Kb. For // large canary scripts, we recommend that you use an S3 location instead of // inputting it directly with this parameter. ZipFile []byte noSmithyDocumentSerde } // This structure contains information about the canary's Lambda handler and where // its code is stored by CloudWatch Synthetics. type CanaryCodeOutput struct { // The entry point to use for the source code when running the canary. Handler *string // The ARN of the Lambda layer where Synthetics stores the canary script code. SourceLocationArn *string noSmithyDocumentSerde } // This structure contains information about the most recent run of a single // canary. type CanaryLastRun struct { // The name of the canary. CanaryName *string // The results from this canary's most recent run. LastRun *CanaryRun noSmithyDocumentSerde } // This structure contains the details about one run of one canary. type CanaryRun struct { // The location where the canary stored artifacts from the run. Artifacts include // the log file, screenshots, and HAR files. ArtifactS3Location *string // A unique ID that identifies this canary run. Id *string // The name of the canary. Name *string // The status of this run. Status *CanaryRunStatus // A structure that contains the start and end times of this run. Timeline *CanaryRunTimeline noSmithyDocumentSerde } // A structure that contains input information for a canary run. type CanaryRunConfigInput struct { // Specifies whether this canary is to use active X-Ray tracing when it runs. // Active tracing enables this canary run to be displayed in the ServiceLens and // X-Ray service maps even if the canary does not hit an endpoint that has X-Ray // tracing enabled. Using X-Ray tracing incurs charges. For more information, see // Canaries and X-Ray tracing (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_tracing.html) // . You can enable active tracing only for canaries that use version // syn-nodejs-2.0 or later for their canary runtime. ActiveTracing *bool // Specifies the keys and values to use for any environment variables used in the // canary script. Use the following format: { "key1" : "value1", "key2" : "value2", // ...} Keys must start with a letter and be at least two characters. The total // size of your environment variables cannot exceed 4 KB. You can't specify any // Lambda reserved environment variables as the keys for your environment // variables. For more information about reserved keys, see Runtime environment // variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime) // . The environment variables keys and values are not encrypted. Do not store // sensitive information in this field. EnvironmentVariables map[string]string // The maximum amount of memory available to the canary while it is running, in // MB. This value must be a multiple of 64. MemoryInMB *int32 // How long the canary is allowed to run before it must stop. You can't set this // time to be longer than the frequency of the runs of this canary. If you omit // this field, the frequency of the canary is used as this value, up to a maximum // of 14 minutes. TimeoutInSeconds *int32 noSmithyDocumentSerde } // A structure that contains information about a canary run. type CanaryRunConfigOutput struct { // Displays whether this canary run used active X-Ray tracing. ActiveTracing *bool // The maximum amount of memory available to the canary while it is running, in // MB. This value must be a multiple of 64. MemoryInMB *int32 // How long the canary is allowed to run before it must stop. TimeoutInSeconds *int32 noSmithyDocumentSerde } // This structure contains the status information about a canary run. type CanaryRunStatus struct { // The current state of the run. State CanaryRunState // If run of the canary failed, this field contains the reason for the error. StateReason *string // If this value is CANARY_FAILURE , an exception occurred in the canary code. If // this value is EXECUTION_FAILURE , an exception occurred in CloudWatch Synthetics. StateReasonCode CanaryRunStateReasonCode noSmithyDocumentSerde } // This structure contains the start and end times of a single canary run. type CanaryRunTimeline struct { // The end time of the run. Completed *time.Time // The start time of the run. Started *time.Time noSmithyDocumentSerde } // This structure specifies how often a canary is to make runs and the date and // time when it should stop making runs. type CanaryScheduleInput struct { // A rate expression or a cron expression that defines how often the canary is to // run. For a rate expression, The syntax is rate(number unit) . unit can be minute // , minutes , or hour . For example, rate(1 minute) runs the canary once a // minute, rate(10 minutes) runs it once every 10 minutes, and rate(1 hour) runs // it once every hour. You can specify a frequency between rate(1 minute) and // rate(1 hour) . Specifying rate(0 minute) or rate(0 hour) is a special value // that causes the canary to run only once when it is started. Use cron(expression) // to specify a cron expression. You can't schedule a canary to wait for more than // a year before running. For information about the syntax for cron expressions, // see Scheduling canary runs using cron (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html) // . // // This member is required. Expression *string // How long, in seconds, for the canary to continue making regular runs according // to the schedule in the Expression value. If you specify 0, the canary continues // making runs until you stop it. If you omit this field, the default of 0 is used. DurationInSeconds *int64 noSmithyDocumentSerde } // How long, in seconds, for the canary to continue making regular runs according // to the schedule in the Expression value. type CanaryScheduleOutput struct { // How long, in seconds, for the canary to continue making regular runs after it // was created. The runs are performed according to the schedule in the Expression // value. DurationInSeconds *int64 // A rate expression or a cron expression that defines how often the canary is to // run. For a rate expression, The syntax is rate(number unit) . unit can be minute // , minutes , or hour . For example, rate(1 minute) runs the canary once a // minute, rate(10 minutes) runs it once every 10 minutes, and rate(1 hour) runs // it once every hour. You can specify a frequency between rate(1 minute) and // rate(1 hour) . Specifying rate(0 minute) or rate(0 hour) is a special value // that causes the canary to run only once when it is started. Use cron(expression) // to specify a cron expression. For information about the syntax for cron // expressions, see Scheduling canary runs using cron (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html) // . Expression *string noSmithyDocumentSerde } // A structure that contains the current state of the canary. type CanaryStatus struct { // The current state of the canary. State CanaryState // If the canary has insufficient permissions to run, this field provides more // details. StateReason *string // If the canary cannot run or has failed, this field displays the reason. StateReasonCode CanaryStateReasonCode noSmithyDocumentSerde } // This structure contains information about when the canary was created and // modified. type CanaryTimeline struct { // The date and time the canary was created. Created *time.Time // The date and time the canary was most recently modified. LastModified *time.Time // The date and time that the canary's most recent run started. LastStarted *time.Time // The date and time that the canary's most recent run ended. LastStopped *time.Time noSmithyDocumentSerde } // This structure contains information about one group. type Group struct { // The ARN of the group. Arn *string // The date and time that the group was created. CreatedTime *time.Time // The unique ID of the group. Id *string // The date and time that the group was most recently updated. LastModifiedTime *time.Time // The name of the group. Name *string // The list of key-value pairs that are associated with the canary. Tags map[string]string noSmithyDocumentSerde } // A structure containing some information about a group. type GroupSummary struct { // The ARN of the group. Arn *string // The unique ID of the group. Id *string // The name of the group. Name *string noSmithyDocumentSerde } // This structure contains information about one canary runtime version. For more // information about runtime versions, see Canary Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . type RuntimeVersion struct { // If this runtime version is deprecated, this value is the date of deprecation. DeprecationDate *time.Time // A description of the runtime version, created by Amazon. Description *string // The date that the runtime version was released. ReleaseDate *time.Time // The name of the runtime version. For a list of valid runtime versions, see // Canary Runtime Versions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) // . VersionName *string noSmithyDocumentSerde } // A structure that contains the configuration of encryption-at-rest settings for // canary artifacts that the canary uploads to Amazon S3. For more information, see // Encrypting canary artifacts (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_artifact_encryption.html) type S3EncryptionConfig struct { // The encryption method to use for artifacts created by this canary. Specify // SSE_S3 to use server-side encryption (SSE) with an Amazon S3-managed key. // Specify SSE-KMS to use server-side encryption with a customer-managed KMS key. // If you omit this parameter, an Amazon Web Services-managed KMS key is used. EncryptionMode EncryptionMode // The ARN of the customer-managed KMS key to use, if you specify SSE-KMS for // EncryptionMode KmsKeyArn *string noSmithyDocumentSerde } // An object that specifies what screenshots to use as a baseline for visual // monitoring by this canary. It can optionally also specify parts of the // screenshots to ignore during the visual monitoring comparison. Visual monitoring // is supported only on canaries running the syn-puppeteer-node-3.2 runtime or // later. For more information, see Visual monitoring (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_SyntheticsLogger_VisualTesting.html) // and Visual monitoring blueprint (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Blueprints_VisualTesting.html) type VisualReferenceInput struct { // Specifies which canary run to use the screenshots from as the baseline for // future visual monitoring with this canary. Valid values are nextrun to use the // screenshots from the next run after this update is made, lastrun to use the // screenshots from the most recent run before this update was made, or the value // of Id in the CanaryRun (https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CanaryRun.html) // from any past run of this canary. // // This member is required. BaseCanaryRunId *string // An array of screenshots that will be used as the baseline for visual monitoring // in future runs of this canary. If there is a screenshot that you don't want to // be used for visual monitoring, remove it from this array. BaseScreenshots []BaseScreenshot noSmithyDocumentSerde } // If this canary performs visual monitoring by comparing screenshots, this // structure contains the ID of the canary run that is used as the baseline for // screenshots, and the coordinates of any parts of those screenshots that are // ignored during visual monitoring comparison. Visual monitoring is supported only // on canaries running the syn-puppeteer-node-3.2 runtime or later. type VisualReferenceOutput struct { // The ID of the canary run that produced the baseline screenshots that are used // for visual monitoring comparisons by this canary. BaseCanaryRunId *string // An array of screenshots that are used as the baseline for comparisons during // visual monitoring. BaseScreenshots []BaseScreenshot noSmithyDocumentSerde } // If this canary is to test an endpoint in a VPC, this structure contains // information about the subnets and security groups of the VPC endpoint. For more // information, see Running a Canary in a VPC (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html) // . type VpcConfigInput struct { // The IDs of the security groups for this canary. SecurityGroupIds []string // The IDs of the subnets where this canary is to run. SubnetIds []string noSmithyDocumentSerde } // If this canary is to test an endpoint in a VPC, this structure contains // information about the subnets and security groups of the VPC endpoint. For more // information, see Running a Canary in a VPC (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html) // . type VpcConfigOutput struct { // The IDs of the security groups for this canary. SecurityGroupIds []string // The IDs of the subnets where this canary is to run. SubnetIds []string // The IDs of the VPC where this canary is to run. VpcId *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
539
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Textract" const ServiceAPIVersion = "2018-06-27" // Client provides the API client to make operations call for Amazon Textract. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "textract", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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 textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Analyzes an input document for relationships between detected items. The types // of information returned are as follows: // - Form data (key-value pairs). The related information is returned in two // Block objects, each of type KEY_VALUE_SET : a KEY Block object and a VALUE // Block object. For example, Name: Ana Silva Carolina contains a key and value. // Name: is the key. Ana Silva Carolina is the value. // - Table and table cell data. A TABLE Block object contains information about a // detected table. A CELL Block object is returned for each cell in a table. // - Lines and words of text. A LINE Block object contains one or more WORD Block // objects. All lines and words that are detected in the document are returned // (including text that doesn't have a relationship with the value of // FeatureTypes ). // - Signatures. A SIGNATURE Block object contains the location information of a // signature in a document. If used in conjunction with forms or tables, a // signature can be given a Key-Value pairing or be detected in the cell of a // table. // - Query. A QUERY Block object contains the query text, alias and link to the // associated Query results block object. // - Query Result. A QUERY_RESULT Block object contains the answer to the query // and an ID that connects it to the query asked. This Block also contains a // confidence score. // // Selection elements such as check boxes and option buttons (radio buttons) can // be detected in form data and in tables. A SELECTION_ELEMENT Block object // contains information about a selection element, including the selection status. // You can choose which type of analysis to perform by specifying the FeatureTypes // list. The output is returned in a list of Block objects. AnalyzeDocument is a // synchronous operation. To analyze documents asynchronously, use // StartDocumentAnalysis . For more information, see Document Text Analysis (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html) // . func (c *Client) AnalyzeDocument(ctx context.Context, params *AnalyzeDocumentInput, optFns ...func(*Options)) (*AnalyzeDocumentOutput, error) { if params == nil { params = &AnalyzeDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "AnalyzeDocument", params, optFns, c.addOperationAnalyzeDocumentMiddlewares) if err != nil { return nil, err } out := result.(*AnalyzeDocumentOutput) out.ResultMetadata = metadata return out, nil } type AnalyzeDocumentInput struct { // The input document as base64-encoded bytes or an Amazon S3 object. If you use // the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The // document must be an image in JPEG, PNG, PDF, or TIFF format. If you're using an // AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes // that are passed using the Bytes field. // // This member is required. Document *types.Document // A list of the types of analysis to perform. Add TABLES to the list to return // information about the tables that are detected in the input document. Add FORMS // to return detected form data. Add SIGNATURES to return the locations of detected // signatures. To perform both forms and table analysis, add TABLES and FORMS to // FeatureTypes . To detect signatures within form data and table data, add // SIGNATURES to either TABLES or FORMS. All lines and words detected in the // document are included in the response (including text that isn't related to the // value of FeatureTypes ). // // This member is required. FeatureTypes []types.FeatureType // Sets the configuration for the human in the loop workflow for analyzing // documents. HumanLoopConfig *types.HumanLoopConfig // Contains Queries and the alias for those Queries, as determined by the input. QueriesConfig *types.QueriesConfig noSmithyDocumentSerde } type AnalyzeDocumentOutput struct { // The version of the model used to analyze the document. AnalyzeDocumentModelVersion *string // The items that are detected and analyzed by AnalyzeDocument . Blocks []types.Block // Metadata about the analyzed document. An example is the number of pages. DocumentMetadata *types.DocumentMetadata // Shows the results of the human in the loop evaluation. HumanLoopActivationOutput *types.HumanLoopActivationOutput // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAnalyzeDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAnalyzeDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAnalyzeDocument{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAnalyzeDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAnalyzeDocument(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAnalyzeDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "AnalyzeDocument", } }
186
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // AnalyzeExpense synchronously analyzes an input document for financially related // relationships between text. Information is returned as ExpenseDocuments and // seperated as follows: // - LineItemGroups - A data set containing LineItems which store information // about the lines of text, such as an item purchased and its price on a receipt. // - SummaryFields - Contains all other information a receipt, such as header // information or the vendors name. func (c *Client) AnalyzeExpense(ctx context.Context, params *AnalyzeExpenseInput, optFns ...func(*Options)) (*AnalyzeExpenseOutput, error) { if params == nil { params = &AnalyzeExpenseInput{} } result, metadata, err := c.invokeOperation(ctx, "AnalyzeExpense", params, optFns, c.addOperationAnalyzeExpenseMiddlewares) if err != nil { return nil, err } out := result.(*AnalyzeExpenseOutput) out.ResultMetadata = metadata return out, nil } type AnalyzeExpenseInput struct { // The input document, either as bytes or as an S3 object. You pass image bytes to // an Amazon Textract API operation by using the Bytes property. For example, you // would use the Bytes property to pass a document loaded from a local file // system. Image bytes passed by using the Bytes property must be base64 encoded. // Your code might not need to encode document file bytes if you're using an AWS // SDK to call Amazon Textract API operations. You pass images stored in an S3 // bucket to an Amazon Textract API operation by using the S3Object property. // Documents stored in an S3 bucket don't need to be base64 encoded. The AWS Region // for the S3 bucket that contains the S3 object must match the AWS Region that you // use for Amazon Textract operations. If you use the AWS CLI to call Amazon // Textract operations, passing image bytes using the Bytes property isn't // supported. You must first upload the document to an Amazon S3 bucket, and then // call the operation using the S3Object property. For Amazon Textract to process // an S3 object, the user must have permission to access the S3 object. // // This member is required. Document *types.Document noSmithyDocumentSerde } type AnalyzeExpenseOutput struct { // Information about the input document. DocumentMetadata *types.DocumentMetadata // The expenses detected by Amazon Textract. ExpenseDocuments []types.ExpenseDocument // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAnalyzeExpenseMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAnalyzeExpense{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAnalyzeExpense{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAnalyzeExpenseValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAnalyzeExpense(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAnalyzeExpense(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "AnalyzeExpense", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Analyzes identity documents for relevant information. This information is // extracted and returned as IdentityDocumentFields , which records both the // normalized field and value of the extracted text. Unlike other Amazon Textract // operations, AnalyzeID doesn't return any Geometry data. func (c *Client) AnalyzeID(ctx context.Context, params *AnalyzeIDInput, optFns ...func(*Options)) (*AnalyzeIDOutput, error) { if params == nil { params = &AnalyzeIDInput{} } result, metadata, err := c.invokeOperation(ctx, "AnalyzeID", params, optFns, c.addOperationAnalyzeIDMiddlewares) if err != nil { return nil, err } out := result.(*AnalyzeIDOutput) out.ResultMetadata = metadata return out, nil } type AnalyzeIDInput struct { // The document being passed to AnalyzeID. // // This member is required. DocumentPages []types.Document noSmithyDocumentSerde } type AnalyzeIDOutput struct { // The version of the AnalyzeIdentity API being used to process documents. AnalyzeIDModelVersion *string // Information about the input document. DocumentMetadata *types.DocumentMetadata // The list of documents processed by AnalyzeID. Includes a number denoting their // place in the list and the response structure for the document. IdentityDocuments []types.IdentityDocument // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAnalyzeIDMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAnalyzeID{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAnalyzeID{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAnalyzeIDValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAnalyzeID(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAnalyzeID(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "AnalyzeID", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Detects text in the input document. Amazon Textract can detect lines of text // and the words that make up a line of text. The input document must be in one of // the following image formats: JPEG, PNG, PDF, or TIFF. DetectDocumentText // returns the detected text in an array of Block objects. Each document page has // as an associated Block of type PAGE. Each PAGE Block object is the parent of // LINE Block objects that represent the lines of detected text on a page. A LINE // Block object is a parent for each word that makes up the line. Words are // represented by Block objects of type WORD. DetectDocumentText is a synchronous // operation. To analyze documents asynchronously, use StartDocumentTextDetection . // For more information, see Document Text Detection (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html) // . func (c *Client) DetectDocumentText(ctx context.Context, params *DetectDocumentTextInput, optFns ...func(*Options)) (*DetectDocumentTextOutput, error) { if params == nil { params = &DetectDocumentTextInput{} } result, metadata, err := c.invokeOperation(ctx, "DetectDocumentText", params, optFns, c.addOperationDetectDocumentTextMiddlewares) if err != nil { return nil, err } out := result.(*DetectDocumentTextOutput) out.ResultMetadata = metadata return out, nil } type DetectDocumentTextInput struct { // The input document as base64-encoded bytes or an Amazon S3 object. If you use // the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The // document must be an image in JPEG or PNG format. If you're using an AWS SDK to // call Amazon Textract, you might not need to base64-encode image bytes that are // passed using the Bytes field. // // This member is required. Document *types.Document noSmithyDocumentSerde } type DetectDocumentTextOutput struct { // An array of Block objects that contain the text that's detected in the document. Blocks []types.Block // DetectDocumentTextModelVersion *string // Metadata about the document. It contains the number of pages that are detected // in the document. DocumentMetadata *types.DocumentMetadata // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDetectDocumentTextMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDetectDocumentText{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDetectDocumentText{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDetectDocumentTextValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetectDocumentText(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDetectDocumentText(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "DetectDocumentText", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the results for an Amazon Textract asynchronous operation that analyzes // text in a document. You start asynchronous text analysis by calling // StartDocumentAnalysis , which returns a job identifier ( JobId ). When the text // analysis operation finishes, Amazon Textract publishes a completion status to // the Amazon Simple Notification Service (Amazon SNS) topic that's registered in // the initial call to StartDocumentAnalysis . To get the results of the // text-detection operation, first check that the status value published to the // Amazon SNS topic is SUCCEEDED . If so, call GetDocumentAnalysis , and pass the // job identifier ( JobId ) from the initial call to StartDocumentAnalysis . // GetDocumentAnalysis returns an array of Block objects. The following types of // information are returned: // - Form data (key-value pairs). The related information is returned in two // Block objects, each of type KEY_VALUE_SET : a KEY Block object and a VALUE // Block object. For example, Name: Ana Silva Carolina contains a key and value. // Name: is the key. Ana Silva Carolina is the value. // - Table and table cell data. A TABLE Block object contains information about a // detected table. A CELL Block object is returned for each cell in a table. // - Lines and words of text. A LINE Block object contains one or more WORD Block // objects. All lines and words that are detected in the document are returned // (including text that doesn't have a relationship with the value of the // StartDocumentAnalysis FeatureTypes input parameter). // - Query. A QUERY Block object contains the query text, alias and link to the // associated Query results block object. // - Query Results. A QUERY_RESULT Block object contains the answer to the query // and an ID that connects it to the query asked. This Block also contains a // confidence score. // // While processing a document with queries, look out for // INVALID_REQUEST_PARAMETERS output. This indicates that either the per page query // limit has been exceeded or that the operation is trying to query a page in the // document which doesn’t exist. Selection elements such as check boxes and option // buttons (radio buttons) can be detected in form data and in tables. A // SELECTION_ELEMENT Block object contains information about a selection element, // including the selection status. Use the MaxResults parameter to limit the // number of blocks that are returned. If there are more results than specified in // MaxResults , the value of NextToken in the operation response contains a // pagination token for getting the next set of results. To get the next page of // results, call GetDocumentAnalysis , and populate the NextToken request // parameter with the token value that's returned from the previous call to // GetDocumentAnalysis . For more information, see Document Text Analysis (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html) // . func (c *Client) GetDocumentAnalysis(ctx context.Context, params *GetDocumentAnalysisInput, optFns ...func(*Options)) (*GetDocumentAnalysisOutput, error) { if params == nil { params = &GetDocumentAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDocumentAnalysis", params, optFns, c.addOperationGetDocumentAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*GetDocumentAnalysisOutput) out.ResultMetadata = metadata return out, nil } type GetDocumentAnalysisInput struct { // A unique identifier for the text-detection job. The JobId is returned from // StartDocumentAnalysis . A JobId value is only valid for 7 days. // // This member is required. JobId *string // The maximum number of results to return per paginated call. The largest value // that you can specify is 1,000. If you specify a value greater than 1,000, a // maximum of 1,000 results is returned. The default value is 1,000. MaxResults *int32 // If the previous response was incomplete (because there are more blocks to // retrieve), Amazon Textract returns a pagination token in the response. You can // use this pagination token to retrieve the next set of blocks. NextToken *string noSmithyDocumentSerde } type GetDocumentAnalysisOutput struct { // AnalyzeDocumentModelVersion *string // The results of the text-analysis operation. Blocks []types.Block // Information about a document that Amazon Textract processed. DocumentMetadata // is returned in every page of paginated responses from an Amazon Textract video // operation. DocumentMetadata *types.DocumentMetadata // The current status of the text detection job. JobStatus types.JobStatus // If the response is truncated, Amazon Textract returns this token. You can use // this token in the subsequent request to retrieve the next set of text detection // results. NextToken *string // Returns if the detection job could not be completed. Contains explanation for // what error occured. StatusMessage *string // A list of warnings that occurred during the document-analysis operation. Warnings []types.Warning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDocumentAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDocumentAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDocumentAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDocumentAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDocumentAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDocumentAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "GetDocumentAnalysis", } }
199
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the results for an Amazon Textract asynchronous operation that detects // text in a document. Amazon Textract can detect lines of text and the words that // make up a line of text. You start asynchronous text detection by calling // StartDocumentTextDetection , which returns a job identifier ( JobId ). When the // text detection operation finishes, Amazon Textract publishes a completion status // to the Amazon Simple Notification Service (Amazon SNS) topic that's registered // in the initial call to StartDocumentTextDetection . To get the results of the // text-detection operation, first check that the status value published to the // Amazon SNS topic is SUCCEEDED . If so, call GetDocumentTextDetection , and pass // the job identifier ( JobId ) from the initial call to StartDocumentTextDetection // . GetDocumentTextDetection returns an array of Block objects. Each document // page has as an associated Block of type PAGE. Each PAGE Block object is the // parent of LINE Block objects that represent the lines of detected text on a // page. A LINE Block object is a parent for each word that makes up the line. // Words are represented by Block objects of type WORD. Use the MaxResults // parameter to limit the number of blocks that are returned. If there are more // results than specified in MaxResults , the value of NextToken in the operation // response contains a pagination token for getting the next set of results. To get // the next page of results, call GetDocumentTextDetection , and populate the // NextToken request parameter with the token value that's returned from the // previous call to GetDocumentTextDetection . For more information, see Document // Text Detection (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html) // . func (c *Client) GetDocumentTextDetection(ctx context.Context, params *GetDocumentTextDetectionInput, optFns ...func(*Options)) (*GetDocumentTextDetectionOutput, error) { if params == nil { params = &GetDocumentTextDetectionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDocumentTextDetection", params, optFns, c.addOperationGetDocumentTextDetectionMiddlewares) if err != nil { return nil, err } out := result.(*GetDocumentTextDetectionOutput) out.ResultMetadata = metadata return out, nil } type GetDocumentTextDetectionInput struct { // A unique identifier for the text detection job. The JobId is returned from // StartDocumentTextDetection . A JobId value is only valid for 7 days. // // This member is required. JobId *string // The maximum number of results to return per paginated call. The largest value // you can specify is 1,000. If you specify a value greater than 1,000, a maximum // of 1,000 results is returned. The default value is 1,000. MaxResults *int32 // If the previous response was incomplete (because there are more blocks to // retrieve), Amazon Textract returns a pagination token in the response. You can // use this pagination token to retrieve the next set of blocks. NextToken *string noSmithyDocumentSerde } type GetDocumentTextDetectionOutput struct { // The results of the text-detection operation. Blocks []types.Block // DetectDocumentTextModelVersion *string // Information about a document that Amazon Textract processed. DocumentMetadata // is returned in every page of paginated responses from an Amazon Textract video // operation. DocumentMetadata *types.DocumentMetadata // The current status of the text detection job. JobStatus types.JobStatus // If the response is truncated, Amazon Textract returns this token. You can use // this token in the subsequent request to retrieve the next set of text-detection // results. NextToken *string // Returns if the detection job could not be completed. Contains explanation for // what error occured. StatusMessage *string // A list of warnings that occurred during the text-detection operation for the // document. Warnings []types.Warning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDocumentTextDetectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDocumentTextDetection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDocumentTextDetection{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDocumentTextDetectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDocumentTextDetection(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDocumentTextDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "GetDocumentTextDetection", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the results for an Amazon Textract asynchronous operation that analyzes // invoices and receipts. Amazon Textract finds contact information, items // purchased, and vendor name, from input invoices and receipts. You start // asynchronous invoice/receipt analysis by calling StartExpenseAnalysis , which // returns a job identifier ( JobId ). Upon completion of the invoice/receipt // analysis, Amazon Textract publishes the completion status to the Amazon Simple // Notification Service (Amazon SNS) topic. This topic must be registered in the // initial call to StartExpenseAnalysis . To get the results of the invoice/receipt // analysis operation, first ensure that the status value published to the Amazon // SNS topic is SUCCEEDED . If so, call GetExpenseAnalysis , and pass the job // identifier ( JobId ) from the initial call to StartExpenseAnalysis . Use the // MaxResults parameter to limit the number of blocks that are returned. If there // are more results than specified in MaxResults , the value of NextToken in the // operation response contains a pagination token for getting the next set of // results. To get the next page of results, call GetExpenseAnalysis , and populate // the NextToken request parameter with the token value that's returned from the // previous call to GetExpenseAnalysis . For more information, see Analyzing // Invoices and Receipts (https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html) // . func (c *Client) GetExpenseAnalysis(ctx context.Context, params *GetExpenseAnalysisInput, optFns ...func(*Options)) (*GetExpenseAnalysisOutput, error) { if params == nil { params = &GetExpenseAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "GetExpenseAnalysis", params, optFns, c.addOperationGetExpenseAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*GetExpenseAnalysisOutput) out.ResultMetadata = metadata return out, nil } type GetExpenseAnalysisInput struct { // A unique identifier for the text detection job. The JobId is returned from // StartExpenseAnalysis . A JobId value is only valid for 7 days. // // This member is required. JobId *string // The maximum number of results to return per paginated call. The largest value // you can specify is 20. If you specify a value greater than 20, a maximum of 20 // results is returned. The default value is 20. MaxResults *int32 // If the previous response was incomplete (because there are more blocks to // retrieve), Amazon Textract returns a pagination token in the response. You can // use this pagination token to retrieve the next set of blocks. NextToken *string noSmithyDocumentSerde } type GetExpenseAnalysisOutput struct { // The current model version of AnalyzeExpense. AnalyzeExpenseModelVersion *string // Information about a document that Amazon Textract processed. DocumentMetadata // is returned in every page of paginated responses from an Amazon Textract // operation. DocumentMetadata *types.DocumentMetadata // The expenses detected by Amazon Textract. ExpenseDocuments []types.ExpenseDocument // The current status of the text detection job. JobStatus types.JobStatus // If the response is truncated, Amazon Textract returns this token. You can use // this token in the subsequent request to retrieve the next set of text-detection // results. NextToken *string // Returns if the detection job could not be completed. Contains explanation for // what error occured. StatusMessage *string // A list of warnings that occurred during the text-detection operation for the // document. Warnings []types.Warning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetExpenseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetExpenseAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetExpenseAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetExpenseAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExpenseAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetExpenseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "GetExpenseAnalysis", } }
178
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the results for an Amazon Textract asynchronous operation that analyzes // text in a lending document. You start asynchronous text analysis by calling // StartLendingAnalysis , which returns a job identifier ( JobId ). When the text // analysis operation finishes, Amazon Textract publishes a completion status to // the Amazon Simple Notification Service (Amazon SNS) topic that's registered in // the initial call to StartLendingAnalysis . To get the results of the text // analysis operation, first check that the status value published to the Amazon // SNS topic is SUCCEEDED. If so, call GetLendingAnalysis, and pass the job // identifier ( JobId ) from the initial call to StartLendingAnalysis . func (c *Client) GetLendingAnalysis(ctx context.Context, params *GetLendingAnalysisInput, optFns ...func(*Options)) (*GetLendingAnalysisOutput, error) { if params == nil { params = &GetLendingAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "GetLendingAnalysis", params, optFns, c.addOperationGetLendingAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*GetLendingAnalysisOutput) out.ResultMetadata = metadata return out, nil } type GetLendingAnalysisInput struct { // A unique identifier for the lending or text-detection job. The JobId is // returned from StartLendingAnalysis . A JobId value is only valid for 7 days. // // This member is required. JobId *string // The maximum number of results to return per paginated call. The largest value // that you can specify is 30. If you specify a value greater than 30, a maximum of // 30 results is returned. The default value is 30. MaxResults *int32 // If the previous response was incomplete, Amazon Textract returns a pagination // token in the response. You can use this pagination token to retrieve the next // set of lending results. NextToken *string noSmithyDocumentSerde } type GetLendingAnalysisOutput struct { // The current model version of the Analyze Lending API. AnalyzeLendingModelVersion *string // Information about the input document. DocumentMetadata *types.DocumentMetadata // The current status of the lending analysis job. JobStatus types.JobStatus // If the response is truncated, Amazon Textract returns this token. You can use // this token in the subsequent request to retrieve the next set of lending // results. NextToken *string // Holds the information returned by one of AmazonTextract's document analysis // operations for the pinstripe. Results []types.LendingResult // Returns if the lending analysis job could not be completed. Contains // explanation for what error occurred. StatusMessage *string // A list of warnings that occurred during the lending analysis operation. Warnings []types.Warning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetLendingAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLendingAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLendingAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetLendingAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLendingAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetLendingAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "GetLendingAnalysis", } }
166
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets summarized results for the StartLendingAnalysis operation, which analyzes // text in a lending document. The returned summary consists of information about // documents grouped together by a common document type. Information like detected // signatures, page numbers, and split documents is returned with respect to the // type of grouped document. You start asynchronous text analysis by calling // StartLendingAnalysis , which returns a job identifier ( JobId ). When the text // analysis operation finishes, Amazon Textract publishes a completion status to // the Amazon Simple Notification Service (Amazon SNS) topic that's registered in // the initial call to StartLendingAnalysis . To get the results of the text // analysis operation, first check that the status value published to the Amazon // SNS topic is SUCCEEDED. If so, call GetLendingAnalysisSummary , and pass the job // identifier ( JobId ) from the initial call to StartLendingAnalysis . func (c *Client) GetLendingAnalysisSummary(ctx context.Context, params *GetLendingAnalysisSummaryInput, optFns ...func(*Options)) (*GetLendingAnalysisSummaryOutput, error) { if params == nil { params = &GetLendingAnalysisSummaryInput{} } result, metadata, err := c.invokeOperation(ctx, "GetLendingAnalysisSummary", params, optFns, c.addOperationGetLendingAnalysisSummaryMiddlewares) if err != nil { return nil, err } out := result.(*GetLendingAnalysisSummaryOutput) out.ResultMetadata = metadata return out, nil } type GetLendingAnalysisSummaryInput struct { // A unique identifier for the lending or text-detection job. The JobId is // returned from StartLendingAnalysis. A JobId value is only valid for 7 days. // // This member is required. JobId *string noSmithyDocumentSerde } type GetLendingAnalysisSummaryOutput struct { // The current model version of the Analyze Lending API. AnalyzeLendingModelVersion *string // Information about the input document. DocumentMetadata *types.DocumentMetadata // The current status of the lending analysis job. JobStatus types.JobStatus // Returns if the lending analysis could not be completed. Contains explanation // for what error occurred. StatusMessage *string // Contains summary information for documents grouped by type. Summary *types.LendingSummary // A list of warnings that occurred during the lending analysis operation. Warnings []types.Warning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetLendingAnalysisSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLendingAnalysisSummary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLendingAnalysisSummary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetLendingAnalysisSummaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLendingAnalysisSummary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetLendingAnalysisSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "GetLendingAnalysisSummary", } }
153
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts the asynchronous analysis of an input document for relationships between // detected items such as key-value pairs, tables, and selection elements. // StartDocumentAnalysis can analyze text in documents that are in JPEG, PNG, TIFF, // and PDF format. The documents are stored in an Amazon S3 bucket. Use // DocumentLocation to specify the bucket name and file name of the document. // StartDocumentAnalysis returns a job identifier ( JobId ) that you use to get the // results of the operation. When text analysis is finished, Amazon Textract // publishes a completion status to the Amazon Simple Notification Service (Amazon // SNS) topic that you specify in NotificationChannel . To get the results of the // text analysis operation, first check that the status value published to the // Amazon SNS topic is SUCCEEDED . If so, call GetDocumentAnalysis , and pass the // job identifier ( JobId ) from the initial call to StartDocumentAnalysis . For // more information, see Document Text Analysis (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html) // . func (c *Client) StartDocumentAnalysis(ctx context.Context, params *StartDocumentAnalysisInput, optFns ...func(*Options)) (*StartDocumentAnalysisOutput, error) { if params == nil { params = &StartDocumentAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "StartDocumentAnalysis", params, optFns, c.addOperationStartDocumentAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*StartDocumentAnalysisOutput) out.ResultMetadata = metadata return out, nil } type StartDocumentAnalysisInput struct { // The location of the document to be processed. // // This member is required. DocumentLocation *types.DocumentLocation // A list of the types of analysis to perform. Add TABLES to the list to return // information about the tables that are detected in the input document. Add FORMS // to return detected form data. To perform both types of analysis, add TABLES and // FORMS to FeatureTypes . All lines and words detected in the document are // included in the response (including text that isn't related to the value of // FeatureTypes ). // // This member is required. FeatureTypes []types.FeatureType // The idempotent token that you use to identify the start request. If you use the // same token with multiple StartDocumentAnalysis requests, the same JobId is // returned. Use ClientRequestToken to prevent the same job from being // accidentally started more than once. For more information, see Calling Amazon // Textract Asynchronous Operations (https://docs.aws.amazon.com/textract/latest/dg/api-async.html) // . ClientRequestToken *string // An identifier that you specify that's included in the completion notification // published to the Amazon SNS topic. For example, you can use JobTag to identify // the type of document that the completion notification corresponds to (such as a // tax form or a receipt). JobTag *string // The KMS key used to encrypt the inference results. This can be in either Key ID // or Key Alias format. When a KMS key is provided, the KMS key will be used for // server-side encryption of the objects in the customer bucket. When this // parameter is not enabled, the result will be encrypted server side,using SSE-S3. KMSKeyId *string // The Amazon SNS topic ARN that you want Amazon Textract to publish the // completion status of the operation to. NotificationChannel *types.NotificationChannel // Sets if the output will go to a customer defined bucket. By default, Amazon // Textract will save the results internally to be accessed by the // GetDocumentAnalysis operation. OutputConfig *types.OutputConfig // QueriesConfig *types.QueriesConfig noSmithyDocumentSerde } type StartDocumentAnalysisOutput struct { // The identifier for the document text detection job. Use JobId to identify the // job in a subsequent call to GetDocumentAnalysis . A JobId value is only valid // for 7 days. JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartDocumentAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartDocumentAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartDocumentAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartDocumentAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDocumentAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartDocumentAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "StartDocumentAnalysis", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts the asynchronous detection of text in a document. Amazon Textract can // detect lines of text and the words that make up a line of text. // StartDocumentTextDetection can analyze text in documents that are in JPEG, PNG, // TIFF, and PDF format. The documents are stored in an Amazon S3 bucket. Use // DocumentLocation to specify the bucket name and file name of the document. // StartTextDetection returns a job identifier ( JobId ) that you use to get the // results of the operation. When text detection is finished, Amazon Textract // publishes a completion status to the Amazon Simple Notification Service (Amazon // SNS) topic that you specify in NotificationChannel . To get the results of the // text detection operation, first check that the status value published to the // Amazon SNS topic is SUCCEEDED . If so, call GetDocumentTextDetection , and pass // the job identifier ( JobId ) from the initial call to StartDocumentTextDetection // . For more information, see Document Text Detection (https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html) // . func (c *Client) StartDocumentTextDetection(ctx context.Context, params *StartDocumentTextDetectionInput, optFns ...func(*Options)) (*StartDocumentTextDetectionOutput, error) { if params == nil { params = &StartDocumentTextDetectionInput{} } result, metadata, err := c.invokeOperation(ctx, "StartDocumentTextDetection", params, optFns, c.addOperationStartDocumentTextDetectionMiddlewares) if err != nil { return nil, err } out := result.(*StartDocumentTextDetectionOutput) out.ResultMetadata = metadata return out, nil } type StartDocumentTextDetectionInput struct { // The location of the document to be processed. // // This member is required. DocumentLocation *types.DocumentLocation // The idempotent token that's used to identify the start request. If you use the // same token with multiple StartDocumentTextDetection requests, the same JobId is // returned. Use ClientRequestToken to prevent the same job from being // accidentally started more than once. For more information, see Calling Amazon // Textract Asynchronous Operations (https://docs.aws.amazon.com/textract/latest/dg/api-async.html) // . ClientRequestToken *string // An identifier that you specify that's included in the completion notification // published to the Amazon SNS topic. For example, you can use JobTag to identify // the type of document that the completion notification corresponds to (such as a // tax form or a receipt). JobTag *string // The KMS key used to encrypt the inference results. This can be in either Key ID // or Key Alias format. When a KMS key is provided, the KMS key will be used for // server-side encryption of the objects in the customer bucket. When this // parameter is not enabled, the result will be encrypted server side,using SSE-S3. KMSKeyId *string // The Amazon SNS topic ARN that you want Amazon Textract to publish the // completion status of the operation to. NotificationChannel *types.NotificationChannel // Sets if the output will go to a customer defined bucket. By default Amazon // Textract will save the results internally to be accessed with the // GetDocumentTextDetection operation. OutputConfig *types.OutputConfig noSmithyDocumentSerde } type StartDocumentTextDetectionOutput struct { // The identifier of the text detection job for the document. Use JobId to // identify the job in a subsequent call to GetDocumentTextDetection . A JobId // value is only valid for 7 days. JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartDocumentTextDetectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartDocumentTextDetection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartDocumentTextDetection{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartDocumentTextDetectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDocumentTextDetection(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartDocumentTextDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "StartDocumentTextDetection", } }
169
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts the asynchronous analysis of invoices or receipts for data like contact // information, items purchased, and vendor names. StartExpenseAnalysis can // analyze text in documents that are in JPEG, PNG, and PDF format. The documents // must be stored in an Amazon S3 bucket. Use the DocumentLocation parameter to // specify the name of your S3 bucket and the name of the document in that bucket. // StartExpenseAnalysis returns a job identifier ( JobId ) that you will provide to // GetExpenseAnalysis to retrieve the results of the operation. When the analysis // of the input invoices/receipts is finished, Amazon Textract publishes a // completion status to the Amazon Simple Notification Service (Amazon SNS) topic // that you provide to the NotificationChannel . To obtain the results of the // invoice and receipt analysis operation, ensure that the status value published // to the Amazon SNS topic is SUCCEEDED . If so, call GetExpenseAnalysis , and pass // the job identifier ( JobId ) that was returned by your call to // StartExpenseAnalysis . For more information, see Analyzing Invoices and Receipts (https://docs.aws.amazon.com/textract/latest/dg/invoice-receipts.html) // . func (c *Client) StartExpenseAnalysis(ctx context.Context, params *StartExpenseAnalysisInput, optFns ...func(*Options)) (*StartExpenseAnalysisOutput, error) { if params == nil { params = &StartExpenseAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "StartExpenseAnalysis", params, optFns, c.addOperationStartExpenseAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*StartExpenseAnalysisOutput) out.ResultMetadata = metadata return out, nil } type StartExpenseAnalysisInput struct { // The location of the document to be processed. // // This member is required. DocumentLocation *types.DocumentLocation // The idempotent token that's used to identify the start request. If you use the // same token with multiple StartDocumentTextDetection requests, the same JobId is // returned. Use ClientRequestToken to prevent the same job from being // accidentally started more than once. For more information, see Calling Amazon // Textract Asynchronous Operations (https://docs.aws.amazon.com/textract/latest/dg/api-async.html) ClientRequestToken *string // An identifier you specify that's included in the completion notification // published to the Amazon SNS topic. For example, you can use JobTag to identify // the type of document that the completion notification corresponds to (such as a // tax form or a receipt). JobTag *string // The KMS key used to encrypt the inference results. This can be in either Key ID // or Key Alias format. When a KMS key is provided, the KMS key will be used for // server-side encryption of the objects in the customer bucket. When this // parameter is not enabled, the result will be encrypted server side,using SSE-S3. KMSKeyId *string // The Amazon SNS topic ARN that you want Amazon Textract to publish the // completion status of the operation to. NotificationChannel *types.NotificationChannel // Sets if the output will go to a customer defined bucket. By default, Amazon // Textract will save the results internally to be accessed by the // GetExpenseAnalysis operation. OutputConfig *types.OutputConfig noSmithyDocumentSerde } type StartExpenseAnalysisOutput struct { // A unique identifier for the text detection job. The JobId is returned from // StartExpenseAnalysis . A JobId value is only valid for 7 days. JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartExpenseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartExpenseAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartExpenseAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartExpenseAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExpenseAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartExpenseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "StartExpenseAnalysis", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts the classification and analysis of an input document. // StartLendingAnalysis initiates the classification and analysis of a packet of // lending documents. StartLendingAnalysis operates on a document file located in // an Amazon S3 bucket. StartLendingAnalysis can analyze text in documents that // are in one of the following formats: JPEG, PNG, TIFF, PDF. Use DocumentLocation // to specify the bucket name and the file name of the document. // StartLendingAnalysis returns a job identifier ( JobId ) that you use to get the // results of the operation. When the text analysis is finished, Amazon Textract // publishes a completion status to the Amazon Simple Notification Service (Amazon // SNS) topic that you specify in NotificationChannel . To get the results of the // text analysis operation, first check that the status value published to the // Amazon SNS topic is SUCCEEDED. If the status is SUCCEEDED you can call either // GetLendingAnalysis or GetLendingAnalysisSummary and provide the JobId to obtain // the results of the analysis. If using OutputConfig to specify an Amazon S3 // bucket, the output will be contained within the specified prefix in a directory // labeled with the job-id. In the directory there are 3 sub-directories: // - detailedResponse (contains the GetLendingAnalysis response) // - summaryResponse (for the GetLendingAnalysisSummary response) // - splitDocuments (documents split across logical boundaries) func (c *Client) StartLendingAnalysis(ctx context.Context, params *StartLendingAnalysisInput, optFns ...func(*Options)) (*StartLendingAnalysisOutput, error) { if params == nil { params = &StartLendingAnalysisInput{} } result, metadata, err := c.invokeOperation(ctx, "StartLendingAnalysis", params, optFns, c.addOperationStartLendingAnalysisMiddlewares) if err != nil { return nil, err } out := result.(*StartLendingAnalysisOutput) out.ResultMetadata = metadata return out, nil } type StartLendingAnalysisInput struct { // The Amazon S3 bucket that contains the document to be processed. It's used by // asynchronous operations. The input document can be an image file in JPEG or PNG // format. It can also be a file in PDF format. // // This member is required. DocumentLocation *types.DocumentLocation // The idempotent token that you use to identify the start request. If you use the // same token with multiple StartLendingAnalysis requests, the same JobId is // returned. Use ClientRequestToken to prevent the same job from being // accidentally started more than once. For more information, see Calling Amazon // Textract Asynchronous Operations (https://docs.aws.amazon.com/textract/latest/dg/api-sync.html) // . ClientRequestToken *string // An identifier that you specify to be included in the completion notification // published to the Amazon SNS topic. For example, you can use JobTag to identify // the type of document that the completion notification corresponds to (such as a // tax form or a receipt). JobTag *string // The KMS key used to encrypt the inference results. This can be in either Key ID // or Key Alias format. When a KMS key is provided, the KMS key will be used for // server-side encryption of the objects in the customer bucket. When this // parameter is not enabled, the result will be encrypted server side, using // SSE-S3. KMSKeyId *string // The Amazon Simple Notification Service (Amazon SNS) topic to which Amazon // Textract publishes the completion status of an asynchronous document operation. NotificationChannel *types.NotificationChannel // Sets whether or not your output will go to a user created bucket. Used to set // the name of the bucket, and the prefix on the output file. OutputConfig is an // optional parameter which lets you adjust where your output will be placed. By // default, Amazon Textract will store the results internally and can only be // accessed by the Get API operations. With OutputConfig enabled, you can set the // name of the bucket the output will be sent to the file prefix of the results // where you can download your results. Additionally, you can set the KMSKeyID // parameter to a customer master key (CMK) to encrypt your output. Without this // parameter set Amazon Textract will encrypt server-side using the AWS managed CMK // for Amazon S3. Decryption of Customer Content is necessary for processing of the // documents by Amazon Textract. If your account is opted out under an AI services // opt out policy then all unencrypted Customer Content is immediately and // permanently deleted after the Customer Content has been processed by the // service. No copy of of the output is retained by Amazon Textract. For // information about how to opt out, see Managing AI services opt-out policy. (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // For more information on data privacy, see the Data Privacy FAQ (https://aws.amazon.com/compliance/data-privacy-faq/) // . OutputConfig *types.OutputConfig noSmithyDocumentSerde } type StartLendingAnalysisOutput struct { // A unique identifier for the lending or text-detection job. The JobId is // returned from StartLendingAnalysis . A JobId value is only valid for 7 days. JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartLendingAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartLendingAnalysis{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartLendingAnalysis{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartLendingAnalysisValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartLendingAnalysis(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartLendingAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "textract", OperationName: "StartLendingAnalysis", } }
190
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/textract/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strings" ) type awsAwsjson11_deserializeOpAnalyzeDocument struct { } func (*awsAwsjson11_deserializeOpAnalyzeDocument) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAnalyzeDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorAnalyzeDocument(response, &metadata) } output := &AnalyzeDocumentOutput{} 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_deserializeOpDocumentAnalyzeDocumentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorAnalyzeDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("HumanLoopQuotaExceededException", errorCode): return awsAwsjson11_deserializeErrorHumanLoopQuotaExceededException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAnalyzeExpense struct { } func (*awsAwsjson11_deserializeOpAnalyzeExpense) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAnalyzeExpense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorAnalyzeExpense(response, &metadata) } output := &AnalyzeExpenseOutput{} 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_deserializeOpDocumentAnalyzeExpenseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorAnalyzeExpense(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAnalyzeID struct { } func (*awsAwsjson11_deserializeOpAnalyzeID) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAnalyzeID) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorAnalyzeID(response, &metadata) } output := &AnalyzeIDOutput{} 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_deserializeOpDocumentAnalyzeIDOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorAnalyzeID(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDetectDocumentText struct { } func (*awsAwsjson11_deserializeOpDetectDocumentText) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDetectDocumentText) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDetectDocumentText(response, &metadata) } output := &DetectDocumentTextOutput{} 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_deserializeOpDocumentDetectDocumentTextOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorDetectDocumentText(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetDocumentAnalysis struct { } func (*awsAwsjson11_deserializeOpGetDocumentAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDocumentAnalysis(response, &metadata) } output := &GetDocumentAnalysisOutput{} 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_deserializeOpDocumentGetDocumentAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorGetDocumentAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidJobIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetDocumentTextDetection struct { } func (*awsAwsjson11_deserializeOpGetDocumentTextDetection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDocumentTextDetection(response, &metadata) } output := &GetDocumentTextDetectionOutput{} 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_deserializeOpDocumentGetDocumentTextDetectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorGetDocumentTextDetection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidJobIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetExpenseAnalysis struct { } func (*awsAwsjson11_deserializeOpGetExpenseAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetExpenseAnalysis(response, &metadata) } output := &GetExpenseAnalysisOutput{} 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_deserializeOpDocumentGetExpenseAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorGetExpenseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidJobIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetLendingAnalysis struct { } func (*awsAwsjson11_deserializeOpGetLendingAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetLendingAnalysis(response, &metadata) } output := &GetLendingAnalysisOutput{} 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_deserializeOpDocumentGetLendingAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorGetLendingAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidJobIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetLendingAnalysisSummary struct { } func (*awsAwsjson11_deserializeOpGetLendingAnalysisSummary) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetLendingAnalysisSummary(response, &metadata) } output := &GetLendingAnalysisSummaryOutput{} 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_deserializeOpDocumentGetLendingAnalysisSummaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorGetLendingAnalysisSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidJobIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartDocumentAnalysis struct { } func (*awsAwsjson11_deserializeOpStartDocumentAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartDocumentAnalysis(response, &metadata) } output := &StartDocumentAnalysisOutput{} 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_deserializeOpDocumentStartDocumentAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorStartDocumentAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartDocumentTextDetection struct { } func (*awsAwsjson11_deserializeOpStartDocumentTextDetection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartDocumentTextDetection(response, &metadata) } output := &StartDocumentTextDetectionOutput{} 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_deserializeOpDocumentStartDocumentTextDetectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorStartDocumentTextDetection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartExpenseAnalysis struct { } func (*awsAwsjson11_deserializeOpStartExpenseAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartExpenseAnalysis(response, &metadata) } output := &StartExpenseAnalysisOutput{} 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_deserializeOpDocumentStartExpenseAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartLendingAnalysis struct { } func (*awsAwsjson11_deserializeOpStartLendingAnalysis) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartLendingAnalysis(response, &metadata) } output := &StartLendingAnalysisOutput{} 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_deserializeOpDocumentStartLendingAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer 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_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("BadDocumentException", errorCode): return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) case strings.EqualFold("DocumentTooLargeException", errorCode): return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedDocumentException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedDocumentException(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_deserializeErrorBadDocumentException(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.BadDocumentException{} err := awsAwsjson11_deserializeDocumentBadDocumentException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorDocumentTooLargeException(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.DocumentTooLargeException{} err := awsAwsjson11_deserializeDocumentDocumentTooLargeException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorHumanLoopQuotaExceededException(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.HumanLoopQuotaExceededException{} err := awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorIdempotentParameterMismatchException(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.IdempotentParameterMismatchException{} err := awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorInternalServerError(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.InternalServerError{} err := awsAwsjson11_deserializeDocumentInternalServerError(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorInvalidJobIdException(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.InvalidJobIdException{} err := awsAwsjson11_deserializeDocumentInvalidJobIdException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorInvalidKMSKeyException(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.InvalidKMSKeyException{} err := awsAwsjson11_deserializeDocumentInvalidKMSKeyException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorInvalidParameterException(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.InvalidParameterException{} err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorInvalidS3ObjectException(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.InvalidS3ObjectException{} err := awsAwsjson11_deserializeDocumentInvalidS3ObjectException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorProvisionedThroughputExceededException(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.ProvisionedThroughputExceededException{} err := awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorUnsupportedDocumentException(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.UnsupportedDocumentException{} err := awsAwsjson11_deserializeDocumentUnsupportedDocumentException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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 "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDetections, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AnalyzeIDDetections if *v == nil { sv = &types.AnalyzeIDDetections{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "NormalizedValue": if err := awsAwsjson11_deserializeDocumentNormalizedValue(&sv.NormalizedValue, value); err != nil { return err } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBadDocumentException(v **types.BadDocumentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadDocumentException if *v == nil { sv = &types.BadDocumentException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentBlock(v **types.Block, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Block if *v == nil { sv = &types.Block{} } else { sv = *v } for key, value := range shape { switch key { case "BlockType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BlockType to be of type string, got %T instead", value) } sv.BlockType = types.BlockType(jtv) } case "ColumnIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ColumnIndex = ptr.Int32(int32(i64)) } case "ColumnSpan": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ColumnSpan = ptr.Int32(int32(i64)) } case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "EntityTypes": if err := awsAwsjson11_deserializeDocumentEntityTypes(&sv.EntityTypes, value); err != nil { return err } case "Geometry": if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Page": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Page = ptr.Int32(int32(i64)) } case "Query": if err := awsAwsjson11_deserializeDocumentQuery(&sv.Query, value); err != nil { return err } case "Relationships": if err := awsAwsjson11_deserializeDocumentRelationshipList(&sv.Relationships, value); err != nil { return err } case "RowIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowIndex = ptr.Int32(int32(i64)) } case "RowSpan": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowSpan = ptr.Int32(int32(i64)) } case "SelectionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelectionStatus to be of type string, got %T instead", value) } sv.SelectionStatus = types.SelectionStatus(jtv) } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } case "TextType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TextType to be of type string, got %T instead", value) } sv.TextType = types.TextType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBlockList(v *[]types.Block, 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.Block if *v == nil { cv = []types.Block{} } else { cv = *v } for _, value := range shape { var col types.Block destAddr := &col if err := awsAwsjson11_deserializeDocumentBlock(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BoundingBox if *v == nil { sv = &types.BoundingBox{} } else { sv = *v } for key, value := range shape { switch key { case "Height": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Height = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Height = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "Left": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Left = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Left = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "Top": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Top = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Top = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "Width": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Width = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Width = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDetectedSignature(v **types.DetectedSignature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DetectedSignature if *v == nil { sv = &types.DetectedSignature{} } else { sv = *v } for key, value := range shape { switch key { case "Page": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Page = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDetectedSignatureList(v *[]types.DetectedSignature, 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.DetectedSignature if *v == nil { cv = []types.DetectedSignature{} } else { cv = *v } for _, value := range shape { var col types.DetectedSignature destAddr := &col if err := awsAwsjson11_deserializeDocumentDetectedSignature(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDocumentGroup(v **types.DocumentGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DocumentGroup if *v == nil { sv = &types.DocumentGroup{} } else { sv = *v } for key, value := range shape { switch key { case "DetectedSignatures": if err := awsAwsjson11_deserializeDocumentDetectedSignatureList(&sv.DetectedSignatures, value); err != nil { return err } case "SplitDocuments": if err := awsAwsjson11_deserializeDocumentSplitDocumentList(&sv.SplitDocuments, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } case "UndetectedSignatures": if err := awsAwsjson11_deserializeDocumentUndetectedSignatureList(&sv.UndetectedSignatures, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDocumentGroupList(v *[]types.DocumentGroup, 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.DocumentGroup if *v == nil { cv = []types.DocumentGroup{} } else { cv = *v } for _, value := range shape { var col types.DocumentGroup destAddr := &col if err := awsAwsjson11_deserializeDocumentDocumentGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DocumentMetadata if *v == nil { sv = &types.DocumentMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "Pages": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Pages = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDocumentTooLargeException(v **types.DocumentTooLargeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DocumentTooLargeException if *v == nil { sv = &types.DocumentTooLargeException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentEntityTypes(v *[]types.EntityType, 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.EntityType if *v == nil { cv = []types.EntityType{} } else { cv = *v } for _, value := range shape { var col types.EntityType if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) } col = types.EntityType(jtv) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentExpenseCurrency(v **types.ExpenseCurrency, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseCurrency if *v == nil { sv = &types.ExpenseCurrency{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExpenseDetection(v **types.ExpenseDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseDetection if *v == nil { sv = &types.ExpenseDetection{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "Geometry": if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { return err } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExpenseDocument(v **types.ExpenseDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseDocument if *v == nil { sv = &types.ExpenseDocument{} } else { sv = *v } for key, value := range shape { switch key { case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "ExpenseIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ExpenseIndex = ptr.Int32(int32(i64)) } case "LineItemGroups": if err := awsAwsjson11_deserializeDocumentLineItemGroupList(&sv.LineItemGroups, value); err != nil { return err } case "SummaryFields": if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.SummaryFields, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExpenseDocumentList(v *[]types.ExpenseDocument, 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.ExpenseDocument if *v == nil { cv = []types.ExpenseDocument{} } else { cv = *v } for _, value := range shape { var col types.ExpenseDocument destAddr := &col if err := awsAwsjson11_deserializeDocumentExpenseDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseField if *v == nil { sv = &types.ExpenseField{} } else { sv = *v } for key, value := range shape { switch key { case "Currency": if err := awsAwsjson11_deserializeDocumentExpenseCurrency(&sv.Currency, value); err != nil { return err } case "GroupProperties": if err := awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(&sv.GroupProperties, value); err != nil { return err } case "LabelDetection": if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.LabelDetection, value); err != nil { return err } case "PageNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PageNumber = ptr.Int32(int32(i64)) } case "Type": if err := awsAwsjson11_deserializeDocumentExpenseType(&sv.Type, value); err != nil { return err } case "ValueDetection": if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.ValueDetection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExpenseFieldList(v *[]types.ExpenseField, 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.ExpenseField if *v == nil { cv = []types.ExpenseField{} } else { cv = *v } for _, value := range shape { var col types.ExpenseField destAddr := &col if err := awsAwsjson11_deserializeDocumentExpenseField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentExpenseGroupProperty(v **types.ExpenseGroupProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseGroupProperty if *v == nil { sv = &types.ExpenseGroupProperty{} } else { sv = *v } for key, value := range shape { switch key { case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Types": if err := awsAwsjson11_deserializeDocumentStringList(&sv.Types, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(v *[]types.ExpenseGroupProperty, 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.ExpenseGroupProperty if *v == nil { cv = []types.ExpenseGroupProperty{} } else { cv = *v } for _, value := range shape { var col types.ExpenseGroupProperty destAddr := &col if err := awsAwsjson11_deserializeDocumentExpenseGroupProperty(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentExpenseType(v **types.ExpenseType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExpenseType if *v == nil { sv = &types.ExpenseType{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExtraction(v **types.Extraction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Extraction if *v == nil { sv = &types.Extraction{} } else { sv = *v } for key, value := range shape { switch key { case "ExpenseDocument": if err := awsAwsjson11_deserializeDocumentExpenseDocument(&sv.ExpenseDocument, value); err != nil { return err } case "IdentityDocument": if err := awsAwsjson11_deserializeDocumentIdentityDocument(&sv.IdentityDocument, value); err != nil { return err } case "LendingDocument": if err := awsAwsjson11_deserializeDocumentLendingDocument(&sv.LendingDocument, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExtractionList(v *[]types.Extraction, 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.Extraction if *v == nil { cv = []types.Extraction{} } else { cv = *v } for _, value := range shape { var col types.Extraction destAddr := &col if err := awsAwsjson11_deserializeDocumentExtraction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Geometry if *v == nil { sv = &types.Geometry{} } else { sv = *v } for key, value := range shape { switch key { case "BoundingBox": if err := awsAwsjson11_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { return err } case "Polygon": if err := awsAwsjson11_deserializeDocumentPolygon(&sv.Polygon, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(v **types.HumanLoopActivationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HumanLoopActivationOutput if *v == nil { sv = &types.HumanLoopActivationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HumanLoopActivationConditionsEvaluationResults": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SynthesizedJsonHumanLoopActivationConditionsEvaluationResults to be of type string, got %T instead", value) } sv.HumanLoopActivationConditionsEvaluationResults = ptr.String(jtv) } case "HumanLoopActivationReasons": if err := awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(&sv.HumanLoopActivationReasons, value); err != nil { return err } case "HumanLoopArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HumanLoopArn to be of type string, got %T instead", value) } sv.HumanLoopArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(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 HumanLoopActivationReason to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.HumanLoopQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HumanLoopQuotaExceededException if *v == nil { sv = &types.HumanLoopQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "QuotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "ServiceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IdempotentParameterMismatchException if *v == nil { sv = &types.IdempotentParameterMismatchException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentIdentityDocument(v **types.IdentityDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IdentityDocument if *v == nil { sv = &types.IdentityDocument{} } else { sv = *v } for key, value := range shape { switch key { case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "DocumentIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DocumentIndex = ptr.Int32(int32(i64)) } case "IdentityDocumentFields": if err := awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(&sv.IdentityDocumentFields, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentIdentityDocumentField(v **types.IdentityDocumentField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IdentityDocumentField if *v == nil { sv = &types.IdentityDocumentField{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.Type, value); err != nil { return err } case "ValueDetection": if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.ValueDetection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(v *[]types.IdentityDocumentField, 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.IdentityDocumentField if *v == nil { cv = []types.IdentityDocumentField{} } else { cv = *v } for _, value := range shape { var col types.IdentityDocumentField destAddr := &col if err := awsAwsjson11_deserializeDocumentIdentityDocumentField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentIdentityDocumentList(v *[]types.IdentityDocument, 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.IdentityDocument if *v == nil { cv = []types.IdentityDocument{} } else { cv = *v } for _, value := range shape { var col types.IdentityDocument destAddr := &col if err := awsAwsjson11_deserializeDocumentIdentityDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentIdList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerError if *v == nil { sv = &types.InternalServerError{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentInvalidJobIdException(v **types.InvalidJobIdException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidJobIdException if *v == nil { sv = &types.InvalidJobIdException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentInvalidKMSKeyException(v **types.InvalidKMSKeyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidKMSKeyException if *v == nil { sv = &types.InvalidKMSKeyException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidParameterException if *v == nil { sv = &types.InvalidParameterException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentInvalidS3ObjectException(v **types.InvalidS3ObjectException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidS3ObjectException if *v == nil { sv = &types.InvalidS3ObjectException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentLendingDetection(v **types.LendingDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LendingDetection if *v == nil { sv = &types.LendingDetection{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "Geometry": if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { return err } case "SelectionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelectionStatus to be of type string, got %T instead", value) } sv.SelectionStatus = types.SelectionStatus(jtv) } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLendingDetectionList(v *[]types.LendingDetection, 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.LendingDetection if *v == nil { cv = []types.LendingDetection{} } else { cv = *v } for _, value := range shape { var col types.LendingDetection destAddr := &col if err := awsAwsjson11_deserializeDocumentLendingDetection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLendingDocument(v **types.LendingDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LendingDocument if *v == nil { sv = &types.LendingDocument{} } else { sv = *v } for key, value := range shape { switch key { case "LendingFields": if err := awsAwsjson11_deserializeDocumentLendingFieldList(&sv.LendingFields, value); err != nil { return err } case "SignatureDetections": if err := awsAwsjson11_deserializeDocumentSignatureDetectionList(&sv.SignatureDetections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLendingField(v **types.LendingField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LendingField if *v == nil { sv = &types.LendingField{} } else { sv = *v } for key, value := range shape { switch key { case "KeyDetection": if err := awsAwsjson11_deserializeDocumentLendingDetection(&sv.KeyDetection, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } case "ValueDetections": if err := awsAwsjson11_deserializeDocumentLendingDetectionList(&sv.ValueDetections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLendingFieldList(v *[]types.LendingField, 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.LendingField if *v == nil { cv = []types.LendingField{} } else { cv = *v } for _, value := range shape { var col types.LendingField destAddr := &col if err := awsAwsjson11_deserializeDocumentLendingField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLendingResult(v **types.LendingResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LendingResult if *v == nil { sv = &types.LendingResult{} } else { sv = *v } for key, value := range shape { switch key { case "Extractions": if err := awsAwsjson11_deserializeDocumentExtractionList(&sv.Extractions, value); err != nil { return err } case "Page": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Page = ptr.Int32(int32(i64)) } case "PageClassification": if err := awsAwsjson11_deserializeDocumentPageClassification(&sv.PageClassification, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLendingResultList(v *[]types.LendingResult, 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.LendingResult if *v == nil { cv = []types.LendingResult{} } else { cv = *v } for _, value := range shape { var col types.LendingResult destAddr := &col if err := awsAwsjson11_deserializeDocumentLendingResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLendingSummary(v **types.LendingSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LendingSummary if *v == nil { sv = &types.LendingSummary{} } else { sv = *v } for key, value := range shape { switch key { case "DocumentGroups": if err := awsAwsjson11_deserializeDocumentDocumentGroupList(&sv.DocumentGroups, value); err != nil { return err } case "UndetectedDocumentTypes": if err := awsAwsjson11_deserializeDocumentUndetectedDocumentTypeList(&sv.UndetectedDocumentTypes, value); err != nil { return err } default: _, _ = key, value } } *v = sv 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 "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentLineItemFields(v **types.LineItemFields, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LineItemFields if *v == nil { sv = &types.LineItemFields{} } else { sv = *v } for key, value := range shape { switch key { case "LineItemExpenseFields": if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.LineItemExpenseFields, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLineItemGroup(v **types.LineItemGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LineItemGroup if *v == nil { sv = &types.LineItemGroup{} } else { sv = *v } for key, value := range shape { switch key { case "LineItemGroupIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LineItemGroupIndex = ptr.Int32(int32(i64)) } case "LineItems": if err := awsAwsjson11_deserializeDocumentLineItemList(&sv.LineItems, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLineItemGroupList(v *[]types.LineItemGroup, 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.LineItemGroup if *v == nil { cv = []types.LineItemGroup{} } else { cv = *v } for _, value := range shape { var col types.LineItemGroup destAddr := &col if err := awsAwsjson11_deserializeDocumentLineItemGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLineItemList(v *[]types.LineItemFields, 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.LineItemFields if *v == nil { cv = []types.LineItemFields{} } else { cv = *v } for _, value := range shape { var col types.LineItemFields destAddr := &col if err := awsAwsjson11_deserializeDocumentLineItemFields(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentNormalizedValue(v **types.NormalizedValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NormalizedValue if *v == nil { sv = &types.NormalizedValue{} } else { sv = *v } for key, value := range shape { switch key { case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } case "ValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValueType to be of type string, got %T instead", value) } sv.ValueType = types.ValueType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPageClassification(v **types.PageClassification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PageClassification if *v == nil { sv = &types.PageClassification{} } else { sv = *v } for key, value := range shape { switch key { case "PageNumber": if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageNumber, value); err != nil { return err } case "PageType": if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPageList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPages(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Point if *v == nil { sv = &types.Point{} } else { sv = *v } for key, value := range shape { switch key { case "X": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.X = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.X = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "Y": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Y = float32(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Y = float32(f64) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, 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.Point if *v == nil { cv = []types.Point{} } else { cv = *v } for _, value := range shape { var col types.Point destAddr := &col if err := awsAwsjson11_deserializeDocumentPoint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Prediction if *v == nil { sv = &types.Prediction{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPredictionList(v *[]types.Prediction, 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.Prediction if *v == nil { cv = []types.Prediction{} } else { cv = *v } for _, value := range shape { var col types.Prediction destAddr := &col if err := awsAwsjson11_deserializeDocumentPrediction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(v **types.ProvisionedThroughputExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProvisionedThroughputExceededException if *v == nil { sv = &types.ProvisionedThroughputExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentQuery(v **types.Query, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Query if *v == nil { sv = &types.Query{} } else { sv = *v } for key, value := range shape { switch key { case "Alias": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QueryInput to be of type string, got %T instead", value) } sv.Alias = ptr.String(jtv) } case "Pages": if err := awsAwsjson11_deserializeDocumentQueryPages(&sv.Pages, value); err != nil { return err } case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QueryInput to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentQueryPages(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 QueryPage to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentRelationship(v **types.Relationship, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Relationship if *v == nil { sv = &types.Relationship{} } else { sv = *v } for key, value := range shape { switch key { case "Ids": if err := awsAwsjson11_deserializeDocumentIdList(&sv.Ids, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationshipType to be of type string, got %T instead", value) } sv.Type = types.RelationshipType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRelationshipList(v *[]types.Relationship, 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.Relationship if *v == nil { cv = []types.Relationship{} } else { cv = *v } for _, value := range shape { var col types.Relationship destAddr := &col if err := awsAwsjson11_deserializeDocumentRelationship(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentSignatureDetection(v **types.SignatureDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SignatureDetection if *v == nil { sv = &types.SignatureDetection{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Confidence = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } case "Geometry": if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSignatureDetectionList(v *[]types.SignatureDetection, 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.SignatureDetection if *v == nil { cv = []types.SignatureDetection{} } else { cv = *v } for _, value := range shape { var col types.SignatureDetection destAddr := &col if err := awsAwsjson11_deserializeDocumentSignatureDetection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentSplitDocument(v **types.SplitDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SplitDocument if *v == nil { sv = &types.SplitDocument{} } else { sv = *v } for key, value := range shape { switch key { case "Index": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Index = ptr.Int32(int32(i64)) } case "Pages": if err := awsAwsjson11_deserializeDocumentPageList(&sv.Pages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSplitDocumentList(v *[]types.SplitDocument, 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.SplitDocument if *v == nil { cv = []types.SplitDocument{} } else { cv = *v } for _, value := range shape { var col types.SplitDocument destAddr := &col if err := awsAwsjson11_deserializeDocumentSplitDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func 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 "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentUndetectedDocumentTypeList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentUndetectedSignature(v **types.UndetectedSignature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UndetectedSignature if *v == nil { sv = &types.UndetectedSignature{} } else { sv = *v } for key, value := range shape { switch key { case "Page": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Page = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUndetectedSignatureList(v *[]types.UndetectedSignature, 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.UndetectedSignature if *v == nil { cv = []types.UndetectedSignature{} } else { cv = *v } for _, value := range shape { var col types.UndetectedSignature destAddr := &col if err := awsAwsjson11_deserializeDocumentUndetectedSignature(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentUnsupportedDocumentException(v **types.UnsupportedDocumentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnsupportedDocumentException if *v == nil { sv = &types.UnsupportedDocumentException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentWarning(v **types.Warning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Warning if *v == nil { sv = &types.Warning{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "Pages": if err := awsAwsjson11_deserializeDocumentPages(&sv.Pages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWarnings(v *[]types.Warning, 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.Warning if *v == nil { cv = []types.Warning{} } else { cv = *v } for _, value := range shape { var col types.Warning destAddr := &col if err := awsAwsjson11_deserializeDocumentWarning(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeOpDocumentAnalyzeDocumentOutput(v **AnalyzeDocumentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AnalyzeDocumentOutput if *v == nil { sv = &AnalyzeDocumentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeDocumentModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeDocumentModelVersion = ptr.String(jtv) } case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } case "HumanLoopActivationOutput": if err := awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(&sv.HumanLoopActivationOutput, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAnalyzeExpenseOutput(v **AnalyzeExpenseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AnalyzeExpenseOutput if *v == nil { sv = &AnalyzeExpenseOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } case "ExpenseDocuments": if err := awsAwsjson11_deserializeDocumentExpenseDocumentList(&sv.ExpenseDocuments, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAnalyzeIDOutput(v **AnalyzeIDOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AnalyzeIDOutput if *v == nil { sv = &AnalyzeIDOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeIDModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeIDModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } case "IdentityDocuments": if err := awsAwsjson11_deserializeDocumentIdentityDocumentList(&sv.IdentityDocuments, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(v **DetectDocumentTextOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DetectDocumentTextOutput if *v == nil { sv = &DetectDocumentTextOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "DetectDocumentTextModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DetectDocumentTextModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetDocumentAnalysisOutput(v **GetDocumentAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDocumentAnalysisOutput if *v == nil { sv = &GetDocumentAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeDocumentModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeDocumentModelVersion = ptr.String(jtv) } case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } 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 "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "Warnings": if err := awsAwsjson11_deserializeDocumentWarnings(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetDocumentTextDetectionOutput(v **GetDocumentTextDetectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDocumentTextDetectionOutput if *v == nil { sv = &GetDocumentTextDetectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Blocks": if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } case "DetectDocumentTextModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DetectDocumentTextModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } 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 "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "Warnings": if err := awsAwsjson11_deserializeDocumentWarnings(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetExpenseAnalysisOutput(v **GetExpenseAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetExpenseAnalysisOutput if *v == nil { sv = &GetExpenseAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeExpenseModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeExpenseModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } case "ExpenseDocuments": if err := awsAwsjson11_deserializeDocumentExpenseDocumentList(&sv.ExpenseDocuments, value); err != nil { return err } 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 "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "Warnings": if err := awsAwsjson11_deserializeDocumentWarnings(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetLendingAnalysisOutput(v **GetLendingAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetLendingAnalysisOutput if *v == nil { sv = &GetLendingAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeLendingModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeLendingModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } 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 "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Results": if err := awsAwsjson11_deserializeDocumentLendingResultList(&sv.Results, value); err != nil { return err } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "Warnings": if err := awsAwsjson11_deserializeDocumentWarnings(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetLendingAnalysisSummaryOutput(v **GetLendingAnalysisSummaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetLendingAnalysisSummaryOutput if *v == nil { sv = &GetLendingAnalysisSummaryOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalyzeLendingModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnalyzeLendingModelVersion = ptr.String(jtv) } case "DocumentMetadata": if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } 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 "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "Summary": if err := awsAwsjson11_deserializeDocumentLendingSummary(&sv.Summary, value); err != nil { return err } case "Warnings": if err := awsAwsjson11_deserializeDocumentWarnings(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartDocumentAnalysisOutput(v **StartDocumentAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartDocumentAnalysisOutput if *v == nil { sv = &StartDocumentAnalysisOutput{} } 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) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartDocumentTextDetectionOutput(v **StartDocumentTextDetectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartDocumentTextDetectionOutput if *v == nil { sv = &StartDocumentTextDetectionOutput{} } 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) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartExpenseAnalysisOutput(v **StartExpenseAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartExpenseAnalysisOutput if *v == nil { sv = &StartExpenseAnalysisOutput{} } 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) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartLendingAnalysisOutput(v **StartLendingAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartLendingAnalysisOutput if *v == nil { sv = &StartLendingAnalysisOutput{} } 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) } default: _, _ = key, value } } *v = sv return nil }
6,919
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package textract provides the API client, operations, and parameter types for // Amazon Textract. // // Amazon Textract detects and analyzes text in documents and converts it into // machine-readable text. This is the API reference documentation for Amazon // Textract. package textract
10
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract 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/textract/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 = "textract" } 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 textract // goModuleVersion is the tagged release for this module const goModuleVersion = "1.21.6"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/textract/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpAnalyzeDocument struct { } func (*awsAwsjson11_serializeOpAnalyzeDocument) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAnalyzeDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AnalyzeDocumentInput) _ = 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("Textract.AnalyzeDocument") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAnalyzeDocumentInput(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_serializeOpAnalyzeExpense struct { } func (*awsAwsjson11_serializeOpAnalyzeExpense) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAnalyzeExpense) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AnalyzeExpenseInput) _ = 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("Textract.AnalyzeExpense") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAnalyzeExpenseInput(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_serializeOpAnalyzeID struct { } func (*awsAwsjson11_serializeOpAnalyzeID) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAnalyzeID) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AnalyzeIDInput) _ = 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("Textract.AnalyzeID") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAnalyzeIDInput(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_serializeOpDetectDocumentText struct { } func (*awsAwsjson11_serializeOpDetectDocumentText) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDetectDocumentText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DetectDocumentTextInput) _ = 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("Textract.DetectDocumentText") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(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_serializeOpGetDocumentAnalysis struct { } func (*awsAwsjson11_serializeOpGetDocumentAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDocumentAnalysisInput) _ = 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("Textract.GetDocumentAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetDocumentAnalysisInput(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_serializeOpGetDocumentTextDetection struct { } func (*awsAwsjson11_serializeOpGetDocumentTextDetection) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDocumentTextDetectionInput) _ = 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("Textract.GetDocumentTextDetection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetDocumentTextDetectionInput(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_serializeOpGetExpenseAnalysis struct { } func (*awsAwsjson11_serializeOpGetExpenseAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetExpenseAnalysisInput) _ = 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("Textract.GetExpenseAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetExpenseAnalysisInput(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_serializeOpGetLendingAnalysis struct { } func (*awsAwsjson11_serializeOpGetLendingAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetLendingAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetLendingAnalysisInput) _ = 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("Textract.GetLendingAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisInput(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_serializeOpGetLendingAnalysisSummary struct { } func (*awsAwsjson11_serializeOpGetLendingAnalysisSummary) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetLendingAnalysisSummaryInput) _ = 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("Textract.GetLendingAnalysisSummary") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisSummaryInput(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_serializeOpStartDocumentAnalysis struct { } func (*awsAwsjson11_serializeOpStartDocumentAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartDocumentAnalysisInput) _ = 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("Textract.StartDocumentAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartDocumentAnalysisInput(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_serializeOpStartDocumentTextDetection struct { } func (*awsAwsjson11_serializeOpStartDocumentTextDetection) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartDocumentTextDetectionInput) _ = 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("Textract.StartDocumentTextDetection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartDocumentTextDetectionInput(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_serializeOpStartExpenseAnalysis struct { } func (*awsAwsjson11_serializeOpStartExpenseAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartExpenseAnalysisInput) _ = 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("Textract.StartExpenseAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartExpenseAnalysisInput(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_serializeOpStartLendingAnalysis struct { } func (*awsAwsjson11_serializeOpStartLendingAnalysis) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartLendingAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartLendingAnalysisInput) _ = 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("Textract.StartLendingAnalysis") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartLendingAnalysisInput(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_serializeDocumentContentClassifiers(v []types.ContentClassifier, 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_serializeDocumentDocument(v *types.Document, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bytes != nil { ok := object.Key("Bytes") ok.Base64EncodeBytes(v.Bytes) } if v.S3Object != nil { ok := object.Key("S3Object") if err := awsAwsjson11_serializeDocumentS3Object(v.S3Object, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentDocumentLocation(v *types.DocumentLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Object != nil { ok := object.Key("S3Object") if err := awsAwsjson11_serializeDocumentS3Object(v.S3Object, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentDocumentPages(v []types.Document, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentDocument(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentFeatureTypes(v []types.FeatureType, 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_serializeDocumentHumanLoopConfig(v *types.HumanLoopConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataAttributes != nil { ok := object.Key("DataAttributes") if err := awsAwsjson11_serializeDocumentHumanLoopDataAttributes(v.DataAttributes, ok); err != nil { return err } } if v.FlowDefinitionArn != nil { ok := object.Key("FlowDefinitionArn") ok.String(*v.FlowDefinitionArn) } if v.HumanLoopName != nil { ok := object.Key("HumanLoopName") ok.String(*v.HumanLoopName) } return nil } func awsAwsjson11_serializeDocumentHumanLoopDataAttributes(v *types.HumanLoopDataAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ContentClassifiers != nil { ok := object.Key("ContentClassifiers") if err := awsAwsjson11_serializeDocumentContentClassifiers(v.ContentClassifiers, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentNotificationChannel(v *types.NotificationChannel, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoleArn != nil { ok := object.Key("RoleArn") ok.String(*v.RoleArn) } if v.SNSTopicArn != nil { ok := object.Key("SNSTopicArn") ok.String(*v.SNSTopicArn) } return nil } func awsAwsjson11_serializeDocumentOutputConfig(v *types.OutputConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Bucket != nil { ok := object.Key("S3Bucket") ok.String(*v.S3Bucket) } if v.S3Prefix != nil { ok := object.Key("S3Prefix") ok.String(*v.S3Prefix) } return nil } func awsAwsjson11_serializeDocumentQueries(v []types.Query, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentQuery(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentQueriesConfig(v *types.QueriesConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Queries != nil { ok := object.Key("Queries") if err := awsAwsjson11_serializeDocumentQueries(v.Queries, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentQuery(v *types.Query, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Alias != nil { ok := object.Key("Alias") ok.String(*v.Alias) } if v.Pages != nil { ok := object.Key("Pages") if err := awsAwsjson11_serializeDocumentQueryPages(v.Pages, ok); err != nil { return err } } if v.Text != nil { ok := object.Key("Text") ok.String(*v.Text) } return nil } func awsAwsjson11_serializeDocumentQueryPages(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_serializeDocumentS3Object(v *types.S3Object, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("Bucket") ok.String(*v.Bucket) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Version != nil { ok := object.Key("Version") ok.String(*v.Version) } return nil } func awsAwsjson11_serializeOpDocumentAnalyzeDocumentInput(v *AnalyzeDocumentInput, 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.FeatureTypes != nil { ok := object.Key("FeatureTypes") if err := awsAwsjson11_serializeDocumentFeatureTypes(v.FeatureTypes, ok); err != nil { return err } } if v.HumanLoopConfig != nil { ok := object.Key("HumanLoopConfig") if err := awsAwsjson11_serializeDocumentHumanLoopConfig(v.HumanLoopConfig, ok); err != nil { return err } } if v.QueriesConfig != nil { ok := object.Key("QueriesConfig") if err := awsAwsjson11_serializeDocumentQueriesConfig(v.QueriesConfig, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentAnalyzeExpenseInput(v *AnalyzeExpenseInput, 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 } } return nil } func awsAwsjson11_serializeOpDocumentAnalyzeIDInput(v *AnalyzeIDInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DocumentPages != nil { ok := object.Key("DocumentPages") if err := awsAwsjson11_serializeDocumentDocumentPages(v.DocumentPages, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(v *DetectDocumentTextInput, 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 } } return nil } func awsAwsjson11_serializeOpDocumentGetDocumentAnalysisInput(v *GetDocumentAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } 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_serializeOpDocumentGetDocumentTextDetectionInput(v *GetDocumentTextDetectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } 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_serializeOpDocumentGetExpenseAnalysisInput(v *GetExpenseAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } 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_serializeOpDocumentGetLendingAnalysisInput(v *GetLendingAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobId != nil { ok := object.Key("JobId") ok.String(*v.JobId) } 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_serializeOpDocumentGetLendingAnalysisSummaryInput(v *GetLendingAnalysisSummaryInput, 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_serializeOpDocumentStartDocumentAnalysisInput(v *StartDocumentAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.DocumentLocation != nil { ok := object.Key("DocumentLocation") if err := awsAwsjson11_serializeDocumentDocumentLocation(v.DocumentLocation, ok); err != nil { return err } } if v.FeatureTypes != nil { ok := object.Key("FeatureTypes") if err := awsAwsjson11_serializeDocumentFeatureTypes(v.FeatureTypes, ok); err != nil { return err } } if v.JobTag != nil { ok := object.Key("JobTag") ok.String(*v.JobTag) } if v.KMSKeyId != nil { ok := object.Key("KMSKeyId") ok.String(*v.KMSKeyId) } if v.NotificationChannel != nil { ok := object.Key("NotificationChannel") if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil { return err } } if v.OutputConfig != nil { ok := object.Key("OutputConfig") if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { return err } } if v.QueriesConfig != nil { ok := object.Key("QueriesConfig") if err := awsAwsjson11_serializeDocumentQueriesConfig(v.QueriesConfig, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStartDocumentTextDetectionInput(v *StartDocumentTextDetectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.DocumentLocation != nil { ok := object.Key("DocumentLocation") if err := awsAwsjson11_serializeDocumentDocumentLocation(v.DocumentLocation, ok); err != nil { return err } } if v.JobTag != nil { ok := object.Key("JobTag") ok.String(*v.JobTag) } if v.KMSKeyId != nil { ok := object.Key("KMSKeyId") ok.String(*v.KMSKeyId) } if v.NotificationChannel != nil { ok := object.Key("NotificationChannel") if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil { return err } } if v.OutputConfig != nil { ok := object.Key("OutputConfig") if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStartExpenseAnalysisInput(v *StartExpenseAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.DocumentLocation != nil { ok := object.Key("DocumentLocation") if err := awsAwsjson11_serializeDocumentDocumentLocation(v.DocumentLocation, ok); err != nil { return err } } if v.JobTag != nil { ok := object.Key("JobTag") ok.String(*v.JobTag) } if v.KMSKeyId != nil { ok := object.Key("KMSKeyId") ok.String(*v.KMSKeyId) } if v.NotificationChannel != nil { ok := object.Key("NotificationChannel") if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil { return err } } if v.OutputConfig != nil { ok := object.Key("OutputConfig") if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStartLendingAnalysisInput(v *StartLendingAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.DocumentLocation != nil { ok := object.Key("DocumentLocation") if err := awsAwsjson11_serializeDocumentDocumentLocation(v.DocumentLocation, ok); err != nil { return err } } if v.JobTag != nil { ok := object.Key("JobTag") ok.String(*v.JobTag) } if v.KMSKeyId != nil { ok := object.Key("KMSKeyId") ok.String(*v.KMSKeyId) } if v.NotificationChannel != nil { ok := object.Key("NotificationChannel") if err := awsAwsjson11_serializeDocumentNotificationChannel(v.NotificationChannel, ok); err != nil { return err } } if v.OutputConfig != nil { ok := object.Key("OutputConfig") if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { return err } } return nil }
1,318
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package textract import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/textract/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAnalyzeDocument struct { } func (*validateOpAnalyzeDocument) ID() string { return "OperationInputValidation" } func (m *validateOpAnalyzeDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AnalyzeDocumentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAnalyzeDocumentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAnalyzeExpense struct { } func (*validateOpAnalyzeExpense) ID() string { return "OperationInputValidation" } func (m *validateOpAnalyzeExpense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AnalyzeExpenseInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAnalyzeExpenseInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAnalyzeID struct { } func (*validateOpAnalyzeID) ID() string { return "OperationInputValidation" } func (m *validateOpAnalyzeID) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AnalyzeIDInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAnalyzeIDInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDetectDocumentText struct { } func (*validateOpDetectDocumentText) ID() string { return "OperationInputValidation" } func (m *validateOpDetectDocumentText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DetectDocumentTextInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDetectDocumentTextInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDocumentAnalysis struct { } func (*validateOpGetDocumentAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpGetDocumentAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDocumentAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDocumentAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDocumentTextDetection struct { } func (*validateOpGetDocumentTextDetection) ID() string { return "OperationInputValidation" } func (m *validateOpGetDocumentTextDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDocumentTextDetectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDocumentTextDetectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetExpenseAnalysis struct { } func (*validateOpGetExpenseAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpGetExpenseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetExpenseAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetExpenseAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetLendingAnalysis struct { } func (*validateOpGetLendingAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpGetLendingAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetLendingAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetLendingAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetLendingAnalysisSummary struct { } func (*validateOpGetLendingAnalysisSummary) ID() string { return "OperationInputValidation" } func (m *validateOpGetLendingAnalysisSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetLendingAnalysisSummaryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetLendingAnalysisSummaryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartDocumentAnalysis struct { } func (*validateOpStartDocumentAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpStartDocumentAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartDocumentAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartDocumentAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartDocumentTextDetection struct { } func (*validateOpStartDocumentTextDetection) ID() string { return "OperationInputValidation" } func (m *validateOpStartDocumentTextDetection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartDocumentTextDetectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartDocumentTextDetectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartExpenseAnalysis struct { } func (*validateOpStartExpenseAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpStartExpenseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartExpenseAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartExpenseAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartLendingAnalysis struct { } func (*validateOpStartLendingAnalysis) ID() string { return "OperationInputValidation" } func (m *validateOpStartLendingAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartLendingAnalysisInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartLendingAnalysisInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAnalyzeDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAnalyzeDocument{}, middleware.After) } func addOpAnalyzeExpenseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAnalyzeExpense{}, middleware.After) } func addOpAnalyzeIDValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAnalyzeID{}, middleware.After) } func addOpDetectDocumentTextValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDetectDocumentText{}, middleware.After) } func addOpGetDocumentAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDocumentAnalysis{}, middleware.After) } func addOpGetDocumentTextDetectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDocumentTextDetection{}, middleware.After) } func addOpGetExpenseAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetExpenseAnalysis{}, middleware.After) } func addOpGetLendingAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLendingAnalysis{}, middleware.After) } func addOpGetLendingAnalysisSummaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLendingAnalysisSummary{}, middleware.After) } func addOpStartDocumentAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartDocumentAnalysis{}, middleware.After) } func addOpStartDocumentTextDetectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartDocumentTextDetection{}, middleware.After) } func addOpStartExpenseAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartExpenseAnalysis{}, middleware.After) } func addOpStartLendingAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartLendingAnalysis{}, middleware.After) } func validateHumanLoopConfig(v *types.HumanLoopConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HumanLoopConfig"} if v.HumanLoopName == nil { invalidParams.Add(smithy.NewErrParamRequired("HumanLoopName")) } if v.FlowDefinitionArn == nil { invalidParams.Add(smithy.NewErrParamRequired("FlowDefinitionArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNotificationChannel(v *types.NotificationChannel) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationChannel"} if v.SNSTopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SNSTopicArn")) } if v.RoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOutputConfig(v *types.OutputConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OutputConfig"} if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateQueries(v []types.Query) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Queries"} for i := range v { if err := validateQuery(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateQueriesConfig(v *types.QueriesConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "QueriesConfig"} if v.Queries == nil { invalidParams.Add(smithy.NewErrParamRequired("Queries")) } else if v.Queries != nil { if err := validateQueries(v.Queries); err != nil { invalidParams.AddNested("Queries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateQuery(v *types.Query) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Query"} if v.Text == nil { invalidParams.Add(smithy.NewErrParamRequired("Text")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAnalyzeDocumentInput(v *AnalyzeDocumentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AnalyzeDocumentInput"} if v.Document == nil { invalidParams.Add(smithy.NewErrParamRequired("Document")) } if v.FeatureTypes == nil { invalidParams.Add(smithy.NewErrParamRequired("FeatureTypes")) } if v.HumanLoopConfig != nil { if err := validateHumanLoopConfig(v.HumanLoopConfig); err != nil { invalidParams.AddNested("HumanLoopConfig", err.(smithy.InvalidParamsError)) } } if v.QueriesConfig != nil { if err := validateQueriesConfig(v.QueriesConfig); err != nil { invalidParams.AddNested("QueriesConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAnalyzeExpenseInput(v *AnalyzeExpenseInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AnalyzeExpenseInput"} if v.Document == nil { invalidParams.Add(smithy.NewErrParamRequired("Document")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAnalyzeIDInput(v *AnalyzeIDInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AnalyzeIDInput"} if v.DocumentPages == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentPages")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDetectDocumentTextInput(v *DetectDocumentTextInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DetectDocumentTextInput"} if v.Document == nil { invalidParams.Add(smithy.NewErrParamRequired("Document")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDocumentAnalysisInput(v *GetDocumentAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDocumentAnalysisInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDocumentTextDetectionInput(v *GetDocumentTextDetectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDocumentTextDetectionInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetExpenseAnalysisInput(v *GetExpenseAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetExpenseAnalysisInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetLendingAnalysisInput(v *GetLendingAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetLendingAnalysisInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetLendingAnalysisSummaryInput(v *GetLendingAnalysisSummaryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetLendingAnalysisSummaryInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartDocumentAnalysisInput(v *StartDocumentAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartDocumentAnalysisInput"} if v.DocumentLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentLocation")) } if v.FeatureTypes == nil { invalidParams.Add(smithy.NewErrParamRequired("FeatureTypes")) } if v.NotificationChannel != nil { if err := validateNotificationChannel(v.NotificationChannel); err != nil { invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError)) } } if v.OutputConfig != nil { if err := validateOutputConfig(v.OutputConfig); err != nil { invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) } } if v.QueriesConfig != nil { if err := validateQueriesConfig(v.QueriesConfig); err != nil { invalidParams.AddNested("QueriesConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartDocumentTextDetectionInput(v *StartDocumentTextDetectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartDocumentTextDetectionInput"} if v.DocumentLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentLocation")) } if v.NotificationChannel != nil { if err := validateNotificationChannel(v.NotificationChannel); err != nil { invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError)) } } if v.OutputConfig != nil { if err := validateOutputConfig(v.OutputConfig); err != nil { invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartExpenseAnalysisInput(v *StartExpenseAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartExpenseAnalysisInput"} if v.DocumentLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentLocation")) } if v.NotificationChannel != nil { if err := validateNotificationChannel(v.NotificationChannel); err != nil { invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError)) } } if v.OutputConfig != nil { if err := validateOutputConfig(v.OutputConfig); err != nil { invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartLendingAnalysisInput(v *StartLendingAnalysisInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartLendingAnalysisInput"} if v.DocumentLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentLocation")) } if v.NotificationChannel != nil { if err := validateNotificationChannel(v.NotificationChannel); err != nil { invalidParams.AddNested("NotificationChannel", err.(smithy.InvalidParamsError)) } } if v.OutputConfig != nil { if err := validateOutputConfig(v.OutputConfig); err != nil { invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
682
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 Textract 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: "textract.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "textract-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ 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: "ca-central-1", Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.ca-central-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ Hostname: "textract-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: "textract-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: "textract-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: "textract-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: "textract-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "textract.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "textract-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "textract-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "textract-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "textract.{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: "textract-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: "textract-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: "textract-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: "textract-fips.us-gov-west-1.amazonaws.com", }, }, }, }
451
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 BlockType string // Enum values for BlockType const ( BlockTypeKeyValueSet BlockType = "KEY_VALUE_SET" BlockTypePage BlockType = "PAGE" BlockTypeLine BlockType = "LINE" BlockTypeWord BlockType = "WORD" BlockTypeTable BlockType = "TABLE" BlockTypeCell BlockType = "CELL" BlockTypeSelectionElement BlockType = "SELECTION_ELEMENT" BlockTypeMergedCell BlockType = "MERGED_CELL" BlockTypeTitle BlockType = "TITLE" BlockTypeQuery BlockType = "QUERY" BlockTypeQueryResult BlockType = "QUERY_RESULT" BlockTypeSignature BlockType = "SIGNATURE" BlockTypeTableTitle BlockType = "TABLE_TITLE" BlockTypeTableFooter BlockType = "TABLE_FOOTER" ) // Values returns all known values for BlockType. 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 (BlockType) Values() []BlockType { return []BlockType{ "KEY_VALUE_SET", "PAGE", "LINE", "WORD", "TABLE", "CELL", "SELECTION_ELEMENT", "MERGED_CELL", "TITLE", "QUERY", "QUERY_RESULT", "SIGNATURE", "TABLE_TITLE", "TABLE_FOOTER", } } type ContentClassifier string // Enum values for ContentClassifier const ( ContentClassifierFreeOfPersonallyIdentifiableInformation ContentClassifier = "FreeOfPersonallyIdentifiableInformation" ContentClassifierFreeOfAdultContent ContentClassifier = "FreeOfAdultContent" ) // Values returns all known values for ContentClassifier. 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 (ContentClassifier) Values() []ContentClassifier { return []ContentClassifier{ "FreeOfPersonallyIdentifiableInformation", "FreeOfAdultContent", } } type EntityType string // Enum values for EntityType const ( EntityTypeKey EntityType = "KEY" EntityTypeValue EntityType = "VALUE" EntityTypeColumnHeader EntityType = "COLUMN_HEADER" EntityTypeTableTitle EntityType = "TABLE_TITLE" EntityTypeTableFooter EntityType = "TABLE_FOOTER" EntityTypeTableSectionTitle EntityType = "TABLE_SECTION_TITLE" EntityTypeTableSummary EntityType = "TABLE_SUMMARY" EntityTypeStructuredTable EntityType = "STRUCTURED_TABLE" EntityTypeSemiStructuredTable EntityType = "SEMI_STRUCTURED_TABLE" ) // Values returns all known values for EntityType. 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 (EntityType) Values() []EntityType { return []EntityType{ "KEY", "VALUE", "COLUMN_HEADER", "TABLE_TITLE", "TABLE_FOOTER", "TABLE_SECTION_TITLE", "TABLE_SUMMARY", "STRUCTURED_TABLE", "SEMI_STRUCTURED_TABLE", } } type FeatureType string // Enum values for FeatureType const ( FeatureTypeTables FeatureType = "TABLES" FeatureTypeForms FeatureType = "FORMS" FeatureTypeQueries FeatureType = "QUERIES" FeatureTypeSignatures FeatureType = "SIGNATURES" ) // Values returns all known values for FeatureType. 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 (FeatureType) Values() []FeatureType { return []FeatureType{ "TABLES", "FORMS", "QUERIES", "SIGNATURES", } } type JobStatus string // Enum values for JobStatus const ( JobStatusInProgress JobStatus = "IN_PROGRESS" JobStatusSucceeded JobStatus = "SUCCEEDED" JobStatusFailed JobStatus = "FAILED" JobStatusPartialSuccess JobStatus = "PARTIAL_SUCCESS" ) // 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{ "IN_PROGRESS", "SUCCEEDED", "FAILED", "PARTIAL_SUCCESS", } } type RelationshipType string // Enum values for RelationshipType const ( RelationshipTypeValue RelationshipType = "VALUE" RelationshipTypeChild RelationshipType = "CHILD" RelationshipTypeComplexFeatures RelationshipType = "COMPLEX_FEATURES" RelationshipTypeMergedCell RelationshipType = "MERGED_CELL" RelationshipTypeTitle RelationshipType = "TITLE" RelationshipTypeAnswer RelationshipType = "ANSWER" RelationshipTypeTable RelationshipType = "TABLE" RelationshipTypeTableTitle RelationshipType = "TABLE_TITLE" RelationshipTypeTableFooter RelationshipType = "TABLE_FOOTER" ) // Values returns all known values for RelationshipType. 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 (RelationshipType) Values() []RelationshipType { return []RelationshipType{ "VALUE", "CHILD", "COMPLEX_FEATURES", "MERGED_CELL", "TITLE", "ANSWER", "TABLE", "TABLE_TITLE", "TABLE_FOOTER", } } type SelectionStatus string // Enum values for SelectionStatus const ( SelectionStatusSelected SelectionStatus = "SELECTED" SelectionStatusNotSelected SelectionStatus = "NOT_SELECTED" ) // Values returns all known values for SelectionStatus. 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 (SelectionStatus) Values() []SelectionStatus { return []SelectionStatus{ "SELECTED", "NOT_SELECTED", } } type TextType string // Enum values for TextType const ( TextTypeHandwriting TextType = "HANDWRITING" TextTypePrinted TextType = "PRINTED" ) // Values returns all known values for TextType. 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 (TextType) Values() []TextType { return []TextType{ "HANDWRITING", "PRINTED", } } type ValueType string // Enum values for ValueType const ( ValueTypeDate ValueType = "DATE" ) // Values returns all known values for ValueType. 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 (ValueType) Values() []ValueType { return []ValueType{ "DATE", } }
224
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 aren't authorized to perform the action. Use the Amazon Resource Name (ARN) // of an authorized user or IAM role to perform the operation. type AccessDeniedException struct { Message *string ErrorCodeOverride *string Code *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 } // Amazon Textract isn't able to read the document. For more information on the // document limits in Amazon Textract, see limits . type BadDocumentException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *BadDocumentException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadDocumentException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadDocumentException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadDocumentException" } return *e.ErrorCodeOverride } func (e *BadDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The document can't be processed because it's too large. The maximum document // size for synchronous operations 10 MB. The maximum document size for // asynchronous operations is 500 MB for PDF files. type DocumentTooLargeException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *DocumentTooLargeException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DocumentTooLargeException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DocumentTooLargeException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DocumentTooLargeException" } return *e.ErrorCodeOverride } func (e *DocumentTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates you have exceeded the maximum number of active human in the loop // workflows available type HumanLoopQuotaExceededException struct { Message *string ErrorCodeOverride *string ResourceType *string QuotaCode *string ServiceCode *string Code *string noSmithyDocumentSerde } func (e *HumanLoopQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *HumanLoopQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *HumanLoopQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "HumanLoopQuotaExceededException" } return *e.ErrorCodeOverride } func (e *HumanLoopQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A ClientRequestToken input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to the // operation. type IdempotentParameterMismatchException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *IdempotentParameterMismatchException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *IdempotentParameterMismatchException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *IdempotentParameterMismatchException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "IdempotentParameterMismatchException" } return *e.ErrorCodeOverride } func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Textract experienced a service issue. Try your call again. type InternalServerError struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *InternalServerError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerError" } return *e.ErrorCodeOverride } func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // An invalid job identifier was passed to an asynchronous analysis operation. type InvalidJobIdException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *InvalidJobIdException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidJobIdException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidJobIdException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidJobIdException" } return *e.ErrorCodeOverride } func (e *InvalidJobIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates you do not have decrypt permissions with the KMS key entered, or the // KMS key was entered incorrectly. type InvalidKMSKeyException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *InvalidKMSKeyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidKMSKeyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidKMSKeyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidKMSKeyException" } return *e.ErrorCodeOverride } func (e *InvalidKMSKeyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An input parameter violated a constraint. For example, in synchronous // operations, an InvalidParameterException exception occurs when neither of the // S3Object or Bytes values are supplied in the Document request parameter. // Validate your parameter before calling the API operation again. type InvalidParameterException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *InvalidParameterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidParameterException" } return *e.ErrorCodeOverride } func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Textract is unable to access the S3 object that's specified in the // request. for more information, Configure Access to Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) // For troubleshooting information, see Troubleshooting Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/troubleshooting.html) type InvalidS3ObjectException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *InvalidS3ObjectException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidS3ObjectException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidS3ObjectException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidS3ObjectException" } return *e.ErrorCodeOverride } func (e *InvalidS3ObjectException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An Amazon Textract service limit was exceeded. For example, if you start too // many asynchronous jobs concurrently, calls to start operations ( // StartDocumentTextDetection , for example) raise a LimitExceededException // exception (HTTP status code: 400) until the number of concurrently running jobs // is below the Amazon Textract service limit. type LimitExceededException struct { Message *string ErrorCodeOverride *string Code *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 number of requests exceeded your throughput limit. If you want to increase // this limit, contact Amazon Textract. type ProvisionedThroughputExceededException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ProvisionedThroughputExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ProvisionedThroughputExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ProvisionedThroughputExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ProvisionedThroughputExceededException" } return *e.ErrorCodeOverride } func (e *ProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Textract is temporarily unable to process the request. Try your call // again. type ThrottlingException struct { Message *string ErrorCodeOverride *string Code *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.FaultServer } // The format of the input document isn't supported. Documents for operations can // be in PNG, JPEG, PDF, or TIFF format. type UnsupportedDocumentException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *UnsupportedDocumentException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedDocumentException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedDocumentException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnsupportedDocumentException" } return *e.ErrorCodeOverride } func (e *UnsupportedDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
428
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" cryptorand "crypto/rand" "fmt" "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" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" 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" "net/url" "strings" "time" ) const ServiceID = "Timestream Query" const ServiceAPIVersion = "2018-11-01" // Client provides the API client to make operations call for Amazon Timestream // Query. type Client struct { options Options // cache used to store discovered endpoints endpointCache *internalEndpointDiscovery.EndpointCache } // 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) resolveEnableEndpointDiscovery(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } resolveEndpointCache(client) 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 // Allows configuring endpoint discovery EndpointDiscovery EndpointDiscoveryOptions // 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) resolveEnableEndpointDiscoveryFromConfigSources(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, "timestreamquery", 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 EnableEndpointDiscovery configuration func resolveEnableEndpointDiscoveryFromConfigSources(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveEnableEndpointDiscovery(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointDiscovery.EnableEndpointDiscovery = value } return nil } // 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 } // resolves endpoint cache on client func resolveEndpointCache(c *Client) { c.endpointCache = internalEndpointDiscovery.NewEndpointCache(10) } // EndpointDiscoveryOptions used to configure endpoint discovery type EndpointDiscoveryOptions struct { // Enables endpoint discovery EnableEndpointDiscovery aws.EndpointDiscoveryEnableState // Allows configuring an endpoint resolver to use when attempting an endpoint // discovery api request. EndpointResolverUsedForDiscovery EndpointResolver } func resolveEnableEndpointDiscovery(o *Options) { if o.EndpointDiscovery.EnableEndpointDiscovery != aws.EndpointDiscoveryUnset { return } o.EndpointDiscovery.EnableEndpointDiscovery = aws.EndpointDiscoveryAuto } func (c *Client) handleEndpointDiscoveryFromService(ctx context.Context, input *DescribeEndpointsInput, key string, opt internalEndpointDiscovery.DiscoverEndpointOptions) (internalEndpointDiscovery.Endpoint, error) { // assert endpoint resolver interface is of expected type. endpointResolver, ok := opt.EndpointResolverUsedForDiscovery.(EndpointResolver) if opt.EndpointResolverUsedForDiscovery != nil && !ok { return internalEndpointDiscovery.Endpoint{}, fmt.Errorf("Unexpected endpoint resolver type %T provided for endpoint discovery api call", opt.EndpointResolverUsedForDiscovery) } output, err := c.DescribeEndpoints(ctx, input, func(o *Options) { o.EndpointOptions.DisableHTTPS = opt.DisableHTTPS o.Logger = opt.Logger if endpointResolver != nil { o.EndpointResolver = endpointResolver } }) if err != nil { return internalEndpointDiscovery.Endpoint{}, err } endpoint := internalEndpointDiscovery.Endpoint{} endpoint.Key = key for _, e := range output.Endpoints { if e.Address == nil { continue } address := *e.Address var scheme string if idx := strings.Index(address, "://"); idx != -1 { scheme = address[:idx] } if len(scheme) == 0 { scheme = "https" if opt.DisableHTTPS { scheme = "http" } address = fmt.Sprintf("%s://%s", scheme, address) } cachedInMinutes := e.CachePeriodInMinutes u, err := url.Parse(address) if err != nil { continue } addr := internalEndpointDiscovery.WeightedAddress{ URL: u, Expired: time.Now().Add(time.Duration(cachedInMinutes) * time.Minute).Round(0), } endpoint.Add(addr) } c.endpointCache.Add(endpoint) return endpoint, 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) }
564
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery 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 timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Cancels a query that has been issued. Cancellation is provided only if the // query has not completed running before the cancellation request was issued. // Because cancellation is an idempotent operation, subsequent cancellation // requests will return a CancellationMessage , indicating that the query has // already been canceled. See code sample (https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.cancel-query.html) // for details. func (c *Client) CancelQuery(ctx context.Context, params *CancelQueryInput, optFns ...func(*Options)) (*CancelQueryOutput, error) { if params == nil { params = &CancelQueryInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelQuery", params, optFns, c.addOperationCancelQueryMiddlewares) if err != nil { return nil, err } out := result.(*CancelQueryOutput) out.ResultMetadata = metadata return out, nil } type CancelQueryInput struct { // The ID of the query that needs to be cancelled. QueryID is returned as part of // the query result. // // This member is required. QueryId *string noSmithyDocumentSerde } type CancelQueryOutput struct { // A CancellationMessage is returned when a CancelQuery request for the query // specified by QueryId has already been issued. CancellationMessage *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCancelQuery{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCancelQuery{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addOpCancelQueryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelQuery(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpCancelQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpCancelQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpCancelQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*CancelQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } func newServiceMetadataMiddleware_opCancelQuery(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "CancelQuery", } }
185
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/aws-sdk-go-v2/service/timestreamquery/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Create a scheduled query that will be run on your behalf at the configured // schedule. Timestream assumes the execution role provided as part of the // ScheduledQueryExecutionRoleArn parameter to run the query. You can use the // NotificationConfiguration parameter to configure notification for your scheduled // query operations. func (c *Client) CreateScheduledQuery(ctx context.Context, params *CreateScheduledQueryInput, optFns ...func(*Options)) (*CreateScheduledQueryOutput, error) { if params == nil { params = &CreateScheduledQueryInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateScheduledQuery", params, optFns, c.addOperationCreateScheduledQueryMiddlewares) if err != nil { return nil, err } out := result.(*CreateScheduledQueryOutput) out.ResultMetadata = metadata return out, nil } type CreateScheduledQueryInput struct { // Configuration for error reporting. Error reports will be generated when a // problem is encountered when writing the query results. // // This member is required. ErrorReportConfiguration *types.ErrorReportConfiguration // Name of the scheduled query. // // This member is required. Name *string // Notification configuration for the scheduled query. A notification is sent by // Timestream when a query run finishes, when the state is updated or when you // delete it. // // This member is required. NotificationConfiguration *types.NotificationConfiguration // The query string to run. Parameter names can be specified in the query string @ // character followed by an identifier. The named Parameter @scheduled_runtime is // reserved and can be used in the query to get the time at which the query is // scheduled to run. The timestamp calculated according to the // ScheduleConfiguration parameter, will be the value of @scheduled_runtime // paramater for each query run. For example, consider an instance of a scheduled // query executing on 2021-12-01 00:00:00. For this instance, the // @scheduled_runtime parameter is initialized to the timestamp 2021-12-01 00:00:00 // when invoking the query. // // This member is required. QueryString *string // The schedule configuration for the query. // // This member is required. ScheduleConfiguration *types.ScheduleConfiguration // The ARN for the IAM role that Timestream will assume when running the scheduled // query. // // This member is required. ScheduledQueryExecutionRoleArn *string // Using a ClientToken makes the call to CreateScheduledQuery idempotent, in other // words, making the same request repeatedly will produce the same result. Making // multiple identical CreateScheduledQuery requests has the same effect as making a // single request. // - If CreateScheduledQuery is called without a ClientToken , the Query SDK // generates a ClientToken on your behalf. // - After 8 hours, any request with the same ClientToken is treated as a new // request. ClientToken *string // The Amazon KMS key used to encrypt the scheduled query resource, at-rest. If // the Amazon KMS key is not specified, the scheduled query resource will be // encrypted with a Timestream owned Amazon KMS key. To specify a KMS key, use the // key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix the // name with alias/ If ErrorReportConfiguration uses SSE_KMS as encryption type, // the same KmsKeyId is used to encrypt the error report at rest. KmsKeyId *string // A list of key-value pairs to label the scheduled query. Tags []types.Tag // Configuration used for writing the result of a query. TargetConfiguration *types.TargetConfiguration noSmithyDocumentSerde } type CreateScheduledQueryOutput struct { // ARN for the created scheduled query. // // This member is required. Arn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateScheduledQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateScheduledQuery{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateScheduledQuery{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateScheduledQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addIdempotencyToken_opCreateScheduledQueryMiddleware(stack, options); err != nil { return err } if err = addOpCreateScheduledQueryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateScheduledQuery(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpCreateScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpCreateScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpCreateScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*CreateScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } type idempotencyToken_initializeOpCreateScheduledQuery struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateScheduledQuery) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateScheduledQuery) 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.(*CreateScheduledQueryInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateScheduledQueryInput ") } 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_opCreateScheduledQueryMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateScheduledQuery{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateScheduledQuery(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "CreateScheduledQuery", } }
282
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a given scheduled query. This is an irreversible operation. func (c *Client) DeleteScheduledQuery(ctx context.Context, params *DeleteScheduledQueryInput, optFns ...func(*Options)) (*DeleteScheduledQueryOutput, error) { if params == nil { params = &DeleteScheduledQueryInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteScheduledQuery", params, optFns, c.addOperationDeleteScheduledQueryMiddlewares) if err != nil { return nil, err } out := result.(*DeleteScheduledQueryOutput) out.ResultMetadata = metadata return out, nil } type DeleteScheduledQueryInput struct { // The ARN of the scheduled query. // // This member is required. ScheduledQueryArn *string noSmithyDocumentSerde } type DeleteScheduledQueryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteScheduledQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteScheduledQuery{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteScheduledQuery{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteScheduledQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addOpDeleteScheduledQueryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteScheduledQuery(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpDeleteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpDeleteScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpDeleteScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*DeleteScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } func newServiceMetadataMiddleware_opDeleteScheduledQuery(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "DeleteScheduledQuery", } }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery 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/timestreamquery/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // DescribeEndpoints returns a list of available endpoints to make Timestream API // calls against. This API is available through both Write and Query. Because the // Timestream SDKs are designed to transparently work with the service’s // architecture, including the management and mapping of the service endpoints, it // is not recommended that you use this API unless: // - You are using VPC endpoints (Amazon Web Services PrivateLink) with // Timestream (https://docs.aws.amazon.com/timestream/latest/developerguide/VPCEndpoints) // - Your application uses a programming language that does not yet have SDK // support // - You require better control over the client-side implementation // // For detailed information on how and when to use and implement // DescribeEndpoints, see The Endpoint Discovery Pattern (https://docs.aws.amazon.com/timestream/latest/developerguide/Using.API.html#Using-API.endpoint-discovery) // . func (c *Client) DescribeEndpoints(ctx context.Context, params *DescribeEndpointsInput, optFns ...func(*Options)) (*DescribeEndpointsOutput, error) { if params == nil { params = &DescribeEndpointsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEndpoints", params, optFns, c.addOperationDescribeEndpointsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEndpointsOutput) out.ResultMetadata = metadata return out, nil } type DescribeEndpointsInput struct { noSmithyDocumentSerde } type DescribeEndpointsOutput struct { // An Endpoints object is returned when a DescribeEndpoints request is made. // // This member is required. Endpoints []types.Endpoint // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeEndpoints{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeEndpoints{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeEndpoints(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "DescribeEndpoints", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/aws-sdk-go-v2/service/timestreamquery/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides detailed information about a scheduled query. func (c *Client) DescribeScheduledQuery(ctx context.Context, params *DescribeScheduledQueryInput, optFns ...func(*Options)) (*DescribeScheduledQueryOutput, error) { if params == nil { params = &DescribeScheduledQueryInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeScheduledQuery", params, optFns, c.addOperationDescribeScheduledQueryMiddlewares) if err != nil { return nil, err } out := result.(*DescribeScheduledQueryOutput) out.ResultMetadata = metadata return out, nil } type DescribeScheduledQueryInput struct { // The ARN of the scheduled query. // // This member is required. ScheduledQueryArn *string noSmithyDocumentSerde } type DescribeScheduledQueryOutput struct { // The scheduled query. // // This member is required. ScheduledQuery *types.ScheduledQueryDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeScheduledQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeScheduledQuery{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeScheduledQuery{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeScheduledQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addOpDescribeScheduledQueryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeScheduledQuery(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpDescribeScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpDescribeScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpDescribeScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*DescribeScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } func newServiceMetadataMiddleware_opDescribeScheduledQuery(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "DescribeScheduledQuery", } }
181
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // You can use this API to run a scheduled query manually. func (c *Client) ExecuteScheduledQuery(ctx context.Context, params *ExecuteScheduledQueryInput, optFns ...func(*Options)) (*ExecuteScheduledQueryOutput, error) { if params == nil { params = &ExecuteScheduledQueryInput{} } result, metadata, err := c.invokeOperation(ctx, "ExecuteScheduledQuery", params, optFns, c.addOperationExecuteScheduledQueryMiddlewares) if err != nil { return nil, err } out := result.(*ExecuteScheduledQueryOutput) out.ResultMetadata = metadata return out, nil } type ExecuteScheduledQueryInput struct { // The timestamp in UTC. Query will be run as if it was invoked at this timestamp. // // This member is required. InvocationTime *time.Time // ARN of the scheduled query. // // This member is required. ScheduledQueryArn *string // Not used. ClientToken *string noSmithyDocumentSerde } type ExecuteScheduledQueryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationExecuteScheduledQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpExecuteScheduledQuery{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpExecuteScheduledQuery{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpExecuteScheduledQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addIdempotencyToken_opExecuteScheduledQueryMiddleware(stack, options); err != nil { return err } if err = addOpExecuteScheduledQueryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExecuteScheduledQuery(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpExecuteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpExecuteScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpExecuteScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*ExecuteScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } type idempotencyToken_initializeOpExecuteScheduledQuery struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpExecuteScheduledQuery) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpExecuteScheduledQuery) 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.(*ExecuteScheduledQueryInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *ExecuteScheduledQueryInput ") } 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_opExecuteScheduledQueryMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpExecuteScheduledQuery{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opExecuteScheduledQuery(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "ExecuteScheduledQuery", } }
219
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamquery import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/aws-sdk-go-v2/service/timestreamquery/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a list of all scheduled queries in the caller's Amazon account and Region. // ListScheduledQueries is eventually consistent. func (c *Client) ListScheduledQueries(ctx context.Context, params *ListScheduledQueriesInput, optFns ...func(*Options)) (*ListScheduledQueriesOutput, error) { if params == nil { params = &ListScheduledQueriesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListScheduledQueries", params, optFns, c.addOperationListScheduledQueriesMiddlewares) if err != nil { return nil, err } out := result.(*ListScheduledQueriesOutput) out.ResultMetadata = metadata return out, nil } type ListScheduledQueriesInput struct { // The maximum number of items to return in the output. If the total number of // items available is more than the value specified, a NextToken is provided in // the output. To resume pagination, provide the NextToken value as the argument // to the subsequent call to ListScheduledQueriesRequest . MaxResults *int32 // A pagination token to resume pagination. NextToken *string noSmithyDocumentSerde } type ListScheduledQueriesOutput struct { // A list of scheduled queries. // // This member is required. ScheduledQueries []types.ScheduledQuery // A token to specify where to start paginating. This is the NextToken from a // previously truncated response. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListScheduledQueriesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListScheduledQueries{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListScheduledQueries{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListScheduledQueriesDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListScheduledQueries(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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 addOpListScheduledQueriesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpListScheduledQueriesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpListScheduledQueriesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*ListScheduledQueriesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Query.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } // ListScheduledQueriesAPIClient is a client that implements the // ListScheduledQueries operation. type ListScheduledQueriesAPIClient interface { ListScheduledQueries(context.Context, *ListScheduledQueriesInput, ...func(*Options)) (*ListScheduledQueriesOutput, error) } var _ ListScheduledQueriesAPIClient = (*Client)(nil) // ListScheduledQueriesPaginatorOptions is the paginator options for // ListScheduledQueries type ListScheduledQueriesPaginatorOptions struct { // The maximum number of items to return in the output. If the total number of // items available is more than the value specified, a NextToken is provided in // the output. To resume pagination, provide the NextToken value as the argument // to the subsequent call to ListScheduledQueriesRequest . 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 } // ListScheduledQueriesPaginator is a paginator for ListScheduledQueries type ListScheduledQueriesPaginator struct { options ListScheduledQueriesPaginatorOptions client ListScheduledQueriesAPIClient params *ListScheduledQueriesInput nextToken *string firstPage bool } // NewListScheduledQueriesPaginator returns a new ListScheduledQueriesPaginator func NewListScheduledQueriesPaginator(client ListScheduledQueriesAPIClient, params *ListScheduledQueriesInput, optFns ...func(*ListScheduledQueriesPaginatorOptions)) *ListScheduledQueriesPaginator { if params == nil { params = &ListScheduledQueriesInput{} } options := ListScheduledQueriesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListScheduledQueriesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListScheduledQueriesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListScheduledQueries page. func (p *ListScheduledQueriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScheduledQueriesOutput, 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.ListScheduledQueries(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_opListScheduledQueries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "ListScheduledQueries", } }
281