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 sfn
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 and task states using the callback (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token)
// pattern to report to Step Functions that the task represented by the specified
// taskToken is still making progress. This action resets the Heartbeat clock. The
// Heartbeat threshold is specified in the state machine's Amazon States Language
// definition ( HeartbeatSeconds ). This action does not in itself create an event
// in the execution history. However, if the task times out, the execution history
// contains an ActivityTimedOut entry for activities, or a TaskTimedOut entry for
// for tasks using the job run (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-sync)
// or callback (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token)
// pattern. The Timeout of a task, defined in the state machine's Amazon States
// Language definition, is its maximum allowed duration, regardless of the number
// of SendTaskHeartbeat requests received. Use HeartbeatSeconds to configure the
// timeout interval for heartbeats.
func (c *Client) SendTaskHeartbeat(ctx context.Context, params *SendTaskHeartbeatInput, optFns ...func(*Options)) (*SendTaskHeartbeatOutput, error) {
if params == nil {
params = &SendTaskHeartbeatInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendTaskHeartbeat", params, optFns, c.addOperationSendTaskHeartbeatMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendTaskHeartbeatOutput)
out.ResultMetadata = metadata
return out, nil
}
type SendTaskHeartbeatInput struct {
// The token that represents this task. Task tokens are generated by Step
// Functions when tasks are assigned to a worker, or in the context object (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html)
// when a workflow enters a task state. See GetActivityTaskOutput$taskToken .
//
// This member is required.
TaskToken *string
noSmithyDocumentSerde
}
type SendTaskHeartbeatOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendTaskHeartbeatMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpSendTaskHeartbeat{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSendTaskHeartbeat{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSendTaskHeartbeatValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendTaskHeartbeat(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSendTaskHeartbeat(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "SendTaskHeartbeat",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 and task states using the callback (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token)
// pattern to report that the task identified by the taskToken completed
// successfully.
func (c *Client) SendTaskSuccess(ctx context.Context, params *SendTaskSuccessInput, optFns ...func(*Options)) (*SendTaskSuccessOutput, error) {
if params == nil {
params = &SendTaskSuccessInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendTaskSuccess", params, optFns, c.addOperationSendTaskSuccessMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendTaskSuccessOutput)
out.ResultMetadata = metadata
return out, nil
}
type SendTaskSuccessInput struct {
// The JSON output of the task. Length constraints apply to the payload size, and
// are expressed as bytes in UTF-8 encoding.
//
// This member is required.
Output *string
// The token that represents this task. Task tokens are generated by Step
// Functions when tasks are assigned to a worker, or in the context object (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html)
// when a workflow enters a task state. See GetActivityTaskOutput$taskToken .
//
// This member is required.
TaskToken *string
noSmithyDocumentSerde
}
type SendTaskSuccessOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendTaskSuccessMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpSendTaskSuccess{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSendTaskSuccess{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSendTaskSuccessValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendTaskSuccess(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSendTaskSuccess(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "SendTaskSuccess",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Starts a state machine execution. A qualified state machine ARN can either
// refer to a Distributed Map state defined within a state machine, a version ARN,
// or an alias ARN. The following are some examples of qualified and unqualified
// state machine ARNs:
// - The following qualified state machine ARN refers to a Distributed Map state
// with a label mapStateLabel in a state machine named myStateMachine .
// arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel
// If you provide a qualified state machine ARN that refers to a Distributed Map
// state, the request fails with ValidationException .
// - The following qualified state machine ARN refers to an alias named PROD .
// arn::states:::stateMachine: If you provide a qualified state machine ARN that
// refers to a version ARN or an alias ARN, the request starts execution for that
// version or alias.
// - The following unqualified state machine ARN refers to a state machine named
// myStateMachine . arn::states:::stateMachine:
//
// If you start an execution with an unqualified state machine ARN, Step Functions
// uses the latest revision of the state machine for the execution. To start
// executions of a state machine version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// , call StartExecution and provide the version ARN or the ARN of an alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// that points to the version. StartExecution is idempotent for STANDARD
// workflows. For a STANDARD workflow, if you call StartExecution with the same
// name and input as a running execution, the call succeeds and return the same
// response as the original request. If the execution is closed or if the input is
// different, it returns a 400 ExecutionAlreadyExists error. You can reuse names
// after 90 days. StartExecution isn't idempotent for EXPRESS workflows.
func (c *Client) StartExecution(ctx context.Context, params *StartExecutionInput, optFns ...func(*Options)) (*StartExecutionOutput, error) {
if params == nil {
params = &StartExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartExecution", params, optFns, c.addOperationStartExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartExecutionInput struct {
// The Amazon Resource Name (ARN) of the state machine to execute. The
// stateMachineArn parameter accepts one of the following inputs:
// - An unqualified state machine ARN – Refers to a state machine ARN that isn't
// qualified with a version or alias ARN. The following is an example of an
// unqualified state machine ARN. arn::states:::stateMachine: Step Functions
// doesn't associate state machine executions that you start with an unqualified
// ARN with a version. This is true even if that version uses the same revision
// that the execution used.
// - A state machine version ARN – Refers to a version ARN, which is a
// combination of state machine ARN and the version number separated by a colon
// (:). The following is an example of the ARN for version 10.
// arn::states:::stateMachine::10 Step Functions doesn't associate executions
// that you start with a version ARN with any aliases that point to that version.
// - A state machine alias ARN – Refers to an alias ARN, which is a combination
// of state machine ARN and the alias name separated by a colon (:). The following
// is an example of the ARN for an alias named PROD . arn::states:::stateMachine:
// Step Functions associates executions that you start with an alias ARN with that
// alias and the state machine version used for that execution.
//
// This member is required.
StateMachineArn *string
// The string that contains the JSON input data for the execution, for example:
// "input": "{\"first_name\" : \"test\"}" If you don't include any JSON input data,
// you still must include the two braces, for example: "input": "{}" Length
// constraints apply to the payload size, and are expressed as bytes in UTF-8
// encoding.
Input *string
// Optional name of the execution. This name must be unique for your Amazon Web
// Services account, Region, and state machine for 90 days. For more information,
// see Limits Related to State Machine Executions (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions)
// in the Step Functions Developer Guide. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
Name *string
// Passes the X-Ray trace header. The trace header can also be passed in the
// request payload.
TraceHeader *string
noSmithyDocumentSerde
}
type StartExecutionOutput struct {
// The Amazon Resource Name (ARN) that identifies the execution.
//
// This member is required.
ExecutionArn *string
// The date the execution is started.
//
// This member is required.
StartDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "StartExecution",
}
}
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Starts a Synchronous Express state machine execution. StartSyncExecution is not
// available for STANDARD workflows. StartSyncExecution will return a 200 OK
// response, even if your execution fails, because the status code in the API
// response doesn't reflect function errors. Error codes are reserved for errors
// that prevent your execution from running, such as permissions errors, limit
// errors, or issues with your state machine code and configuration. This API
// action isn't logged in CloudTrail.
func (c *Client) StartSyncExecution(ctx context.Context, params *StartSyncExecutionInput, optFns ...func(*Options)) (*StartSyncExecutionOutput, error) {
if params == nil {
params = &StartSyncExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartSyncExecution", params, optFns, c.addOperationStartSyncExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartSyncExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartSyncExecutionInput struct {
// The Amazon Resource Name (ARN) of the state machine to execute.
//
// This member is required.
StateMachineArn *string
// The string that contains the JSON input data for the execution, for example:
// "input": "{\"first_name\" : \"test\"}" If you don't include any JSON input data,
// you still must include the two braces, for example: "input": "{}" Length
// constraints apply to the payload size, and are expressed as bytes in UTF-8
// encoding.
Input *string
// The name of the execution.
Name *string
// Passes the X-Ray trace header. The trace header can also be passed in the
// request payload.
TraceHeader *string
noSmithyDocumentSerde
}
type StartSyncExecutionOutput struct {
// The Amazon Resource Name (ARN) that identifies the execution.
//
// This member is required.
ExecutionArn *string
// The date the execution is started.
//
// This member is required.
StartDate *time.Time
// The current status of the execution.
//
// This member is required.
Status types.SyncExecutionStatus
// If the execution has already ended, the date the execution stopped.
//
// This member is required.
StopDate *time.Time
// An object that describes workflow billing details, including billed duration
// and memory use.
BillingDetails *types.BillingDetails
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
// The string that contains the JSON input data of the execution. Length
// constraints apply to the payload size, and are expressed as bytes in UTF-8
// encoding.
Input *string
// Provides details about execution input or output.
InputDetails *types.CloudWatchEventsExecutionDataDetails
// The name of the execution.
Name *string
// The JSON output data of the execution. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding. This field is set only if
// the execution succeeds. If the execution fails, this field is null.
Output *string
// Provides details about execution input or output.
OutputDetails *types.CloudWatchEventsExecutionDataDetails
// The Amazon Resource Name (ARN) that identifies the state machine.
StateMachineArn *string
// The X-Ray trace header that was passed to the execution.
TraceHeader *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartSyncExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartSyncExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartSyncExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opStartSyncExecutionMiddleware(stack); err != nil {
return err
}
if err = addOpStartSyncExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSyncExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opStartSyncExecutionMiddleware struct {
}
func (*endpointPrefix_opStartSyncExecutionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opStartSyncExecutionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "sync-" + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opStartSyncExecutionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opStartSyncExecutionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opStartSyncExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "StartSyncExecution",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Stops an execution. This API action is not supported by EXPRESS state machines.
func (c *Client) StopExecution(ctx context.Context, params *StopExecutionInput, optFns ...func(*Options)) (*StopExecutionOutput, error) {
if params == nil {
params = &StopExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopExecution", params, optFns, c.addOperationStopExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopExecutionInput struct {
// The Amazon Resource Name (ARN) of the execution to stop.
//
// This member is required.
ExecutionArn *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
type StopExecutionOutput struct {
// The date the execution is stopped.
//
// This member is required.
StopDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpStopExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStopExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "StopExecution",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Add a tag to a Step Functions resource. An array of key-value pairs. For more
// information, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide, and
// Controlling Access Using IAM Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html)
// . Tags may only contain Unicode letters, digits, white space, or these symbols:
// _ . : / = + - @ .
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 Step Functions state machine or activity.
//
// This member is required.
ResourceArn *string
// The list of tags to add to a resource. Tags may only contain Unicode letters,
// digits, white space, or these symbols: _ . : / = + - @ .
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&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: "states",
OperationName: "TagResource",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 Step Functions resource
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) for the Step Functions state machine or activity.
//
// This member is required.
ResourceArn *string
// The list of tags 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(&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: "states",
OperationName: "UntagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an in-progress Map Run's configuration to include changes to the
// settings that control maximum concurrency and Map Run failure.
func (c *Client) UpdateMapRun(ctx context.Context, params *UpdateMapRunInput, optFns ...func(*Options)) (*UpdateMapRunOutput, error) {
if params == nil {
params = &UpdateMapRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateMapRun", params, optFns, c.addOperationUpdateMapRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateMapRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateMapRunInput struct {
// The Amazon Resource Name (ARN) of a Map Run.
//
// This member is required.
MapRunArn *string
// The maximum number of child workflow executions that can be specified to run in
// parallel for the Map Run at the same time.
MaxConcurrency *int32
// The maximum number of failed items before the Map Run fails.
ToleratedFailureCount *int64
// The maximum percentage of failed items before the Map Run fails.
ToleratedFailurePercentage *float32
noSmithyDocumentSerde
}
type UpdateMapRunOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateMapRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateMapRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateMapRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateMapRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMapRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateMapRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "UpdateMapRun",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an existing state machine by modifying its definition , roleArn , or
// loggingConfiguration . Running executions will continue to use the previous
// definition and roleArn . You must include at least one of definition or roleArn
// or you will receive a MissingRequiredParameter error. A qualified state machine
// ARN refers to a Distributed Map state defined within a state machine. For
// example, the qualified state machine ARN
// arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel
// refers to a Distributed Map state with a label mapStateLabel in the state
// machine named stateMachineName . A qualified state machine ARN can either refer
// to a Distributed Map state defined within a state machine, a version ARN, or an
// alias ARN. The following are some examples of qualified and unqualified state
// machine ARNs:
// - The following qualified state machine ARN refers to a Distributed Map state
// with a label mapStateLabel in a state machine named myStateMachine .
// arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel
// If you provide a qualified state machine ARN that refers to a Distributed Map
// state, the request fails with ValidationException .
// - The following qualified state machine ARN refers to an alias named PROD .
// arn::states:::stateMachine: If you provide a qualified state machine ARN that
// refers to a version ARN or an alias ARN, the request starts execution for that
// version or alias.
// - The following unqualified state machine ARN refers to a state machine named
// myStateMachine . arn::states:::stateMachine:
//
// After you update your state machine, you can set the publish parameter to true
// in the same action to publish a new version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// . This way, you can opt-in to strict versioning of your state machine. Step
// Functions assigns monotonically increasing integers for state machine versions,
// starting at version number 1. All StartExecution calls within a few seconds use
// the updated definition and roleArn . Executions started immediately after you
// call UpdateStateMachine may use the previous state machine definition and
// roleArn .
func (c *Client) UpdateStateMachine(ctx context.Context, params *UpdateStateMachineInput, optFns ...func(*Options)) (*UpdateStateMachineOutput, error) {
if params == nil {
params = &UpdateStateMachineInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStateMachine", params, optFns, c.addOperationUpdateStateMachineMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStateMachineOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStateMachineInput struct {
// The Amazon Resource Name (ARN) of the state machine.
//
// This member is required.
StateMachineArn *string
// The Amazon States Language definition of the state machine. See Amazon States
// Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)
// .
Definition *string
// Use the LoggingConfiguration data type to set CloudWatch Logs options.
LoggingConfiguration *types.LoggingConfiguration
// Specifies whether the state machine version is published. The default is false .
// To publish a version after updating the state machine, set publish to true .
Publish bool
// The Amazon Resource Name (ARN) of the IAM role of the state machine.
RoleArn *string
// Selects whether X-Ray tracing is enabled.
TracingConfiguration *types.TracingConfiguration
// An optional description of the state machine version to publish. You can only
// specify the versionDescription parameter if you've set publish to true .
VersionDescription *string
noSmithyDocumentSerde
}
type UpdateStateMachineOutput struct {
// The date and time the state machine was updated.
//
// This member is required.
UpdateDate *time.Time
// The revision identifier for the updated state machine.
RevisionId *string
// The Amazon Resource Name (ARN) of the published state machine version. If the
// publish parameter isn't set to true , this field returns null.
StateMachineVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStateMachineMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateStateMachine{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateStateMachine{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateStateMachineValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStateMachine(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateStateMachine(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "UpdateStateMachine",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the configuration of an existing state machine alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// by modifying its description or routingConfiguration . You must specify at least
// one of the description or routingConfiguration parameters to update a state
// machine alias. UpdateStateMachineAlias is an idempotent API. Step Functions
// bases the idempotency check on the stateMachineAliasArn , description , and
// routingConfiguration parameters. Requests with the same parameters return an
// idempotent response. This operation is eventually consistent. All StartExecution
// requests made within a few seconds use the latest alias configuration.
// Executions started immediately after calling UpdateStateMachineAlias may use
// the previous routing configuration. Related operations:
// - CreateStateMachineAlias
// - DescribeStateMachineAlias
// - ListStateMachineAliases
// - DeleteStateMachineAlias
func (c *Client) UpdateStateMachineAlias(ctx context.Context, params *UpdateStateMachineAliasInput, optFns ...func(*Options)) (*UpdateStateMachineAliasOutput, error) {
if params == nil {
params = &UpdateStateMachineAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStateMachineAlias", params, optFns, c.addOperationUpdateStateMachineAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStateMachineAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStateMachineAliasInput struct {
// The Amazon Resource Name (ARN) of the state machine alias.
//
// This member is required.
StateMachineAliasArn *string
// A description of the state machine alias.
Description *string
// The routing configuration of the state machine alias. An array of RoutingConfig
// objects that specifies up to two state machine versions that the alias starts
// executions for.
RoutingConfiguration []types.RoutingConfigurationListItem
noSmithyDocumentSerde
}
type UpdateStateMachineAliasOutput struct {
// The date and time the state machine alias was updated.
//
// This member is required.
UpdateDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStateMachineAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateStateMachineAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateStateMachineAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateStateMachineAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStateMachineAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateStateMachineAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "UpdateStateMachineAlias",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/sfn/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"
"math"
"strings"
)
type awsAwsjson10_deserializeOpCreateActivity struct {
}
func (*awsAwsjson10_deserializeOpCreateActivity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpCreateActivity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateActivity(response, &metadata)
}
output := &CreateActivityOutput{}
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_deserializeOpDocumentCreateActivityOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateActivity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ActivityLimitExceeded", errorCode):
return awsAwsjson10_deserializeErrorActivityLimitExceeded(response, errorBody)
case strings.EqualFold("InvalidName", errorCode):
return awsAwsjson10_deserializeErrorInvalidName(response, errorBody)
case strings.EqualFold("TooManyTags", errorCode):
return awsAwsjson10_deserializeErrorTooManyTags(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpCreateStateMachine struct {
}
func (*awsAwsjson10_deserializeOpCreateStateMachine) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpCreateStateMachine) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateStateMachine(response, &metadata)
}
output := &CreateStateMachineOutput{}
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_deserializeOpDocumentCreateStateMachineOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateStateMachine(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidDefinition", errorCode):
return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody)
case strings.EqualFold("InvalidLoggingConfiguration", errorCode):
return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody)
case strings.EqualFold("InvalidName", errorCode):
return awsAwsjson10_deserializeErrorInvalidName(response, errorBody)
case strings.EqualFold("InvalidTracingConfiguration", errorCode):
return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody)
case strings.EqualFold("StateMachineAlreadyExists", errorCode):
return awsAwsjson10_deserializeErrorStateMachineAlreadyExists(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineLimitExceeded", errorCode):
return awsAwsjson10_deserializeErrorStateMachineLimitExceeded(response, errorBody)
case strings.EqualFold("StateMachineTypeNotSupported", errorCode):
return awsAwsjson10_deserializeErrorStateMachineTypeNotSupported(response, errorBody)
case strings.EqualFold("TooManyTags", errorCode):
return awsAwsjson10_deserializeErrorTooManyTags(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpCreateStateMachineAlias struct {
}
func (*awsAwsjson10_deserializeOpCreateStateMachineAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpCreateStateMachineAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateStateMachineAlias(response, &metadata)
}
output := &CreateStateMachineAliasOutput{}
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_deserializeOpDocumentCreateStateMachineAliasOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateStateMachineAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidName", errorCode):
return awsAwsjson10_deserializeErrorInvalidName(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDeleteActivity struct {
}
func (*awsAwsjson10_deserializeOpDeleteActivity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDeleteActivity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteActivity(response, &metadata)
}
output := &DeleteActivityOutput{}
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_deserializeOpDocumentDeleteActivityOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteActivity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDeleteStateMachine struct {
}
func (*awsAwsjson10_deserializeOpDeleteStateMachine) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDeleteStateMachine) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteStateMachine(response, &metadata)
}
output := &DeleteStateMachineOutput{}
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_deserializeOpDocumentDeleteStateMachineOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteStateMachine(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDeleteStateMachineAlias struct {
}
func (*awsAwsjson10_deserializeOpDeleteStateMachineAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDeleteStateMachineAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteStateMachineAlias(response, &metadata)
}
output := &DeleteStateMachineAliasOutput{}
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_deserializeOpDocumentDeleteStateMachineAliasOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteStateMachineAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDeleteStateMachineVersion struct {
}
func (*awsAwsjson10_deserializeOpDeleteStateMachineVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDeleteStateMachineVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteStateMachineVersion(response, &metadata)
}
output := &DeleteStateMachineVersionOutput{}
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_deserializeOpDocumentDeleteStateMachineVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteStateMachineVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeActivity struct {
}
func (*awsAwsjson10_deserializeOpDescribeActivity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeActivity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeActivity(response, &metadata)
}
output := &DescribeActivityOutput{}
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_deserializeOpDocumentDescribeActivityOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeActivity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ActivityDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorActivityDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeExecution struct {
}
func (*awsAwsjson10_deserializeOpDescribeExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson10_deserializeOpErrorDescribeExecution(response, &metadata)
}
output := &DescribeExecutionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson10_deserializeOpDocumentDescribeExecutionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson10_deserializeOpErrorDescribeExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeMapRun struct {
}
func (*awsAwsjson10_deserializeOpDescribeMapRun) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeMapRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeMapRun(response, &metadata)
}
output := &DescribeMapRunOutput{}
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_deserializeOpDocumentDescribeMapRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeMapRun(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeStateMachine struct {
}
func (*awsAwsjson10_deserializeOpDescribeStateMachine) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeStateMachine) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeStateMachine(response, &metadata)
}
output := &DescribeStateMachineOutput{}
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_deserializeOpDocumentDescribeStateMachineOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeStateMachine(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeStateMachineAlias struct {
}
func (*awsAwsjson10_deserializeOpDescribeStateMachineAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeStateMachineAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeStateMachineAlias(response, &metadata)
}
output := &DescribeStateMachineAliasOutput{}
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_deserializeOpDocumentDescribeStateMachineAliasOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeStateMachineAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpDescribeStateMachineForExecution struct {
}
func (*awsAwsjson10_deserializeOpDescribeStateMachineForExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpDescribeStateMachineForExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeStateMachineForExecution(response, &metadata)
}
output := &DescribeStateMachineForExecutionOutput{}
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_deserializeOpDocumentDescribeStateMachineForExecutionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeStateMachineForExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpGetActivityTask struct {
}
func (*awsAwsjson10_deserializeOpGetActivityTask) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpGetActivityTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetActivityTask(response, &metadata)
}
output := &GetActivityTaskOutput{}
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_deserializeOpDocumentGetActivityTaskOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorGetActivityTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ActivityDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorActivityDoesNotExist(response, errorBody)
case strings.EqualFold("ActivityWorkerLimitExceeded", errorCode):
return awsAwsjson10_deserializeErrorActivityWorkerLimitExceeded(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpGetExecutionHistory struct {
}
func (*awsAwsjson10_deserializeOpGetExecutionHistory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpGetExecutionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetExecutionHistory(response, &metadata)
}
output := &GetExecutionHistoryOutput{}
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_deserializeOpDocumentGetExecutionHistoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorGetExecutionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListActivities struct {
}
func (*awsAwsjson10_deserializeOpListActivities) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListActivities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListActivities(response, &metadata)
}
output := &ListActivitiesOutput{}
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_deserializeOpDocumentListActivitiesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListActivities(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListExecutions struct {
}
func (*awsAwsjson10_deserializeOpListExecutions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson10_deserializeOpErrorListExecutions(response, &metadata)
}
output := &ListExecutionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson10_deserializeOpDocumentListExecutionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson10_deserializeOpErrorListExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
case strings.EqualFold("StateMachineTypeNotSupported", errorCode):
return awsAwsjson10_deserializeErrorStateMachineTypeNotSupported(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListMapRuns struct {
}
func (*awsAwsjson10_deserializeOpListMapRuns) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListMapRuns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListMapRuns(response, &metadata)
}
output := &ListMapRunsOutput{}
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_deserializeOpDocumentListMapRunsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListMapRuns(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListStateMachineAliases struct {
}
func (*awsAwsjson10_deserializeOpListStateMachineAliases) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListStateMachineAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListStateMachineAliases(response, &metadata)
}
output := &ListStateMachineAliasesOutput{}
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_deserializeOpDocumentListStateMachineAliasesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListStateMachineAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListStateMachines struct {
}
func (*awsAwsjson10_deserializeOpListStateMachines) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListStateMachines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListStateMachines(response, &metadata)
}
output := &ListStateMachinesOutput{}
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_deserializeOpDocumentListStateMachinesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListStateMachines(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpListStateMachineVersions struct {
}
func (*awsAwsjson10_deserializeOpListStateMachineVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpListStateMachineVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListStateMachineVersions(response, &metadata)
}
output := &ListStateMachineVersionsOutput{}
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_deserializeOpDocumentListStateMachineVersionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListStateMachineVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(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("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpPublishStateMachineVersion struct {
}
func (*awsAwsjson10_deserializeOpPublishStateMachineVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpPublishStateMachineVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPublishStateMachineVersion(response, &metadata)
}
output := &PublishStateMachineVersionOutput{}
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_deserializeOpDocumentPublishStateMachineVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorPublishStateMachineVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpSendTaskFailure struct {
}
func (*awsAwsjson10_deserializeOpSendTaskFailure) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpSendTaskFailure) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSendTaskFailure(response, &metadata)
}
output := &SendTaskFailureOutput{}
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_deserializeOpDocumentSendTaskFailureOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorSendTaskFailure(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("TaskDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorTaskDoesNotExist(response, errorBody)
case strings.EqualFold("TaskTimedOut", errorCode):
return awsAwsjson10_deserializeErrorTaskTimedOut(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpSendTaskHeartbeat struct {
}
func (*awsAwsjson10_deserializeOpSendTaskHeartbeat) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpSendTaskHeartbeat) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSendTaskHeartbeat(response, &metadata)
}
output := &SendTaskHeartbeatOutput{}
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_deserializeOpDocumentSendTaskHeartbeatOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorSendTaskHeartbeat(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("TaskDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorTaskDoesNotExist(response, errorBody)
case strings.EqualFold("TaskTimedOut", errorCode):
return awsAwsjson10_deserializeErrorTaskTimedOut(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpSendTaskSuccess struct {
}
func (*awsAwsjson10_deserializeOpSendTaskSuccess) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpSendTaskSuccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSendTaskSuccess(response, &metadata)
}
output := &SendTaskSuccessOutput{}
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_deserializeOpDocumentSendTaskSuccessOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorSendTaskSuccess(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidOutput", errorCode):
return awsAwsjson10_deserializeErrorInvalidOutput(response, errorBody)
case strings.EqualFold("InvalidToken", errorCode):
return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody)
case strings.EqualFold("TaskDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorTaskDoesNotExist(response, errorBody)
case strings.EqualFold("TaskTimedOut", errorCode):
return awsAwsjson10_deserializeErrorTaskTimedOut(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpStartExecution struct {
}
func (*awsAwsjson10_deserializeOpStartExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpStartExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStartExecution(response, &metadata)
}
output := &StartExecutionOutput{}
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_deserializeOpDocumentStartExecutionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorStartExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionAlreadyExists", errorCode):
return awsAwsjson10_deserializeErrorExecutionAlreadyExists(response, errorBody)
case strings.EqualFold("ExecutionLimitExceeded", errorCode):
return awsAwsjson10_deserializeErrorExecutionLimitExceeded(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidExecutionInput", errorCode):
return awsAwsjson10_deserializeErrorInvalidExecutionInput(response, errorBody)
case strings.EqualFold("InvalidName", errorCode):
return awsAwsjson10_deserializeErrorInvalidName(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpStartSyncExecution struct {
}
func (*awsAwsjson10_deserializeOpStartSyncExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpStartSyncExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStartSyncExecution(response, &metadata)
}
output := &StartSyncExecutionOutput{}
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_deserializeOpDocumentStartSyncExecutionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorStartSyncExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidExecutionInput", errorCode):
return awsAwsjson10_deserializeErrorInvalidExecutionInput(response, errorBody)
case strings.EqualFold("InvalidName", errorCode):
return awsAwsjson10_deserializeErrorInvalidName(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
case strings.EqualFold("StateMachineTypeNotSupported", errorCode):
return awsAwsjson10_deserializeErrorStateMachineTypeNotSupported(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpStopExecution struct {
}
func (*awsAwsjson10_deserializeOpStopExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpStopExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStopExecution(response, &metadata)
}
output := &StopExecutionOutput{}
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_deserializeOpDocumentStopExecutionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorStopExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ExecutionDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(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
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_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func 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("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("TooManyTags", errorCode):
return awsAwsjson10_deserializeErrorTooManyTags(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
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_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func 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("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpUpdateMapRun struct {
}
func (*awsAwsjson10_deserializeOpUpdateMapRun) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpUpdateMapRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateMapRun(response, &metadata)
}
output := &UpdateMapRunOutput{}
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_deserializeOpDocumentUpdateMapRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateMapRun(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpUpdateStateMachine struct {
}
func (*awsAwsjson10_deserializeOpUpdateStateMachine) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpUpdateStateMachine) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateStateMachine(response, &metadata)
}
output := &UpdateStateMachineOutput{}
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_deserializeOpDocumentUpdateStateMachineOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateStateMachine(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("InvalidDefinition", errorCode):
return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody)
case strings.EqualFold("InvalidLoggingConfiguration", errorCode):
return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody)
case strings.EqualFold("InvalidTracingConfiguration", errorCode):
return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody)
case strings.EqualFold("MissingRequiredParameter", errorCode):
return awsAwsjson10_deserializeErrorMissingRequiredParameter(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("StateMachineDeleting", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody)
case strings.EqualFold("StateMachineDoesNotExist", errorCode):
return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson10_deserializeOpUpdateStateMachineAlias struct {
}
func (*awsAwsjson10_deserializeOpUpdateStateMachineAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson10_deserializeOpUpdateStateMachineAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateStateMachineAlias(response, &metadata)
}
output := &UpdateStateMachineAliasOutput{}
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_deserializeOpDocumentUpdateStateMachineAliasOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateStateMachineAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidArn", errorCode):
return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody)
case strings.EqualFold("ResourceNotFound", errorCode):
return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson10_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson10_deserializeErrorActivityDoesNotExist(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.ActivityDoesNotExist{}
err := awsAwsjson10_deserializeDocumentActivityDoesNotExist(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorActivityLimitExceeded(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.ActivityLimitExceeded{}
err := awsAwsjson10_deserializeDocumentActivityLimitExceeded(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorActivityWorkerLimitExceeded(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.ActivityWorkerLimitExceeded{}
err := awsAwsjson10_deserializeDocumentActivityWorkerLimitExceeded(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ConflictException{}
err := awsAwsjson10_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson10_deserializeErrorExecutionAlreadyExists(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.ExecutionAlreadyExists{}
err := awsAwsjson10_deserializeDocumentExecutionAlreadyExists(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorExecutionDoesNotExist(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.ExecutionDoesNotExist{}
err := awsAwsjson10_deserializeDocumentExecutionDoesNotExist(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorExecutionLimitExceeded(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.ExecutionLimitExceeded{}
err := awsAwsjson10_deserializeDocumentExecutionLimitExceeded(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidArn(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.InvalidArn{}
err := awsAwsjson10_deserializeDocumentInvalidArn(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidDefinition(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.InvalidDefinition{}
err := awsAwsjson10_deserializeDocumentInvalidDefinition(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidExecutionInput(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.InvalidExecutionInput{}
err := awsAwsjson10_deserializeDocumentInvalidExecutionInput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidLoggingConfiguration(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.InvalidLoggingConfiguration{}
err := awsAwsjson10_deserializeDocumentInvalidLoggingConfiguration(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidName(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.InvalidName{}
err := awsAwsjson10_deserializeDocumentInvalidName(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidOutput(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.InvalidOutput{}
err := awsAwsjson10_deserializeDocumentInvalidOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidToken(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.InvalidToken{}
err := awsAwsjson10_deserializeDocumentInvalidToken(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidTracingConfiguration(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.InvalidTracingConfiguration{}
err := awsAwsjson10_deserializeDocumentInvalidTracingConfiguration(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorMissingRequiredParameter(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.MissingRequiredParameter{}
err := awsAwsjson10_deserializeDocumentMissingRequiredParameter(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorResourceNotFound(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.ResourceNotFound{}
err := awsAwsjson10_deserializeDocumentResourceNotFound(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorServiceQuotaExceededException(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.ServiceQuotaExceededException{}
err := awsAwsjson10_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 awsAwsjson10_deserializeErrorStateMachineAlreadyExists(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.StateMachineAlreadyExists{}
err := awsAwsjson10_deserializeDocumentStateMachineAlreadyExists(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorStateMachineDeleting(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.StateMachineDeleting{}
err := awsAwsjson10_deserializeDocumentStateMachineDeleting(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorStateMachineDoesNotExist(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.StateMachineDoesNotExist{}
err := awsAwsjson10_deserializeDocumentStateMachineDoesNotExist(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorStateMachineLimitExceeded(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.StateMachineLimitExceeded{}
err := awsAwsjson10_deserializeDocumentStateMachineLimitExceeded(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorStateMachineTypeNotSupported(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.StateMachineTypeNotSupported{}
err := awsAwsjson10_deserializeDocumentStateMachineTypeNotSupported(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorTaskDoesNotExist(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.TaskDoesNotExist{}
err := awsAwsjson10_deserializeDocumentTaskDoesNotExist(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorTaskTimedOut(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.TaskTimedOut{}
err := awsAwsjson10_deserializeDocumentTaskTimedOut(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorTooManyTags(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.TooManyTags{}
err := awsAwsjson10_deserializeDocumentTooManyTags(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ValidationException{}
err := awsAwsjson10_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson10_deserializeDocumentActivityDoesNotExist(v **types.ActivityDoesNotExist, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityDoesNotExist
if *v == nil {
sv = &types.ActivityDoesNotExist{}
} 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_deserializeDocumentActivityFailedEventDetails(v **types.ActivityFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityFailedEventDetails
if *v == nil {
sv = &types.ActivityFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivityLimitExceeded(v **types.ActivityLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityLimitExceeded
if *v == nil {
sv = &types.ActivityLimitExceeded{}
} 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_deserializeDocumentActivityList(v *[]types.ActivityListItem, 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.ActivityListItem
if *v == nil {
cv = []types.ActivityListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ActivityListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentActivityListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentActivityListItem(v **types.ActivityListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityListItem
if *v == nil {
sv = &types.ActivityListItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activityArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ActivityArn = ptr.String(jtv)
}
case "creationDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "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_deserializeDocumentActivityScheduledEventDetails(v **types.ActivityScheduledEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityScheduledEventDetails
if *v == nil {
sv = &types.ActivityScheduledEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "heartbeatInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.HeartbeatInSeconds = ptr.Int64(i64)
}
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "timeoutInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutInSeconds = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivityScheduleFailedEventDetails(v **types.ActivityScheduleFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityScheduleFailedEventDetails
if *v == nil {
sv = &types.ActivityScheduleFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivityStartedEventDetails(v **types.ActivityStartedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityStartedEventDetails
if *v == nil {
sv = &types.ActivityStartedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "workerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Identity to be of type string, got %T instead", value)
}
sv.WorkerName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivitySucceededEventDetails(v **types.ActivitySucceededEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivitySucceededEventDetails
if *v == nil {
sv = &types.ActivitySucceededEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivityTimedOutEventDetails(v **types.ActivityTimedOutEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityTimedOutEventDetails
if *v == nil {
sv = &types.ActivityTimedOutEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentActivityWorkerLimitExceeded(v **types.ActivityWorkerLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivityWorkerLimitExceeded
if *v == nil {
sv = &types.ActivityWorkerLimitExceeded{}
} 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_deserializeDocumentBillingDetails(v **types.BillingDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BillingDetails
if *v == nil {
sv = &types.BillingDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "billedDurationInMilliseconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BilledDuration to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BilledDurationInMilliseconds = i64
}
case "billedMemoryUsedInMB":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BilledMemoryUsed to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BilledMemoryUsedInMB = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentCloudWatchEventsExecutionDataDetails(v **types.CloudWatchEventsExecutionDataDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CloudWatchEventsExecutionDataDetails
if *v == nil {
sv = &types.CloudWatchEventsExecutionDataDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "included":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected includedDetails to be of type *bool, got %T instead", value)
}
sv.Included = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentCloudWatchLogsLogGroup(v **types.CloudWatchLogsLogGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CloudWatchLogsLogGroup
if *v == nil {
sv = &types.CloudWatchLogsLogGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LogGroupArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionAbortedEventDetails(v **types.ExecutionAbortedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionAbortedEventDetails
if *v == nil {
sv = &types.ExecutionAbortedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionAlreadyExists(v **types.ExecutionAlreadyExists, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionAlreadyExists
if *v == nil {
sv = &types.ExecutionAlreadyExists{}
} 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_deserializeDocumentExecutionDoesNotExist(v **types.ExecutionDoesNotExist, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionDoesNotExist
if *v == nil {
sv = &types.ExecutionDoesNotExist{}
} 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_deserializeDocumentExecutionFailedEventDetails(v **types.ExecutionFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionFailedEventDetails
if *v == nil {
sv = &types.ExecutionFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionLimitExceeded(v **types.ExecutionLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionLimitExceeded
if *v == nil {
sv = &types.ExecutionLimitExceeded{}
} 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_deserializeDocumentExecutionList(v *[]types.ExecutionListItem, 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.ExecutionListItem
if *v == nil {
cv = []types.ExecutionListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExecutionListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentExecutionListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionListItem(v **types.ExecutionListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionListItem
if *v == nil {
sv = &types.ExecutionListItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "itemCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ItemCount = ptr.Int32(int32(i64))
}
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
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 "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.ExecutionStatus(jtv)
}
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = 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 awsAwsjson10_deserializeDocumentExecutionStartedEventDetails(v **types.ExecutionStartedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionStartedEventDetails
if *v == nil {
sv = &types.ExecutionStartedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionSucceededEventDetails(v **types.ExecutionSucceededEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionSucceededEventDetails
if *v == nil {
sv = &types.ExecutionSucceededEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentExecutionTimedOutEventDetails(v **types.ExecutionTimedOutEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionTimedOutEventDetails
if *v == nil {
sv = &types.ExecutionTimedOutEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
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 "activityFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentActivityFailedEventDetails(&sv.ActivityFailedEventDetails, value); err != nil {
return err
}
case "activityScheduledEventDetails":
if err := awsAwsjson10_deserializeDocumentActivityScheduledEventDetails(&sv.ActivityScheduledEventDetails, value); err != nil {
return err
}
case "activityScheduleFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentActivityScheduleFailedEventDetails(&sv.ActivityScheduleFailedEventDetails, value); err != nil {
return err
}
case "activityStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentActivityStartedEventDetails(&sv.ActivityStartedEventDetails, value); err != nil {
return err
}
case "activitySucceededEventDetails":
if err := awsAwsjson10_deserializeDocumentActivitySucceededEventDetails(&sv.ActivitySucceededEventDetails, value); err != nil {
return err
}
case "activityTimedOutEventDetails":
if err := awsAwsjson10_deserializeDocumentActivityTimedOutEventDetails(&sv.ActivityTimedOutEventDetails, value); err != nil {
return err
}
case "executionAbortedEventDetails":
if err := awsAwsjson10_deserializeDocumentExecutionAbortedEventDetails(&sv.ExecutionAbortedEventDetails, value); err != nil {
return err
}
case "executionFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentExecutionFailedEventDetails(&sv.ExecutionFailedEventDetails, value); err != nil {
return err
}
case "executionStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentExecutionStartedEventDetails(&sv.ExecutionStartedEventDetails, value); err != nil {
return err
}
case "executionSucceededEventDetails":
if err := awsAwsjson10_deserializeDocumentExecutionSucceededEventDetails(&sv.ExecutionSucceededEventDetails, value); err != nil {
return err
}
case "executionTimedOutEventDetails":
if err := awsAwsjson10_deserializeDocumentExecutionTimedOutEventDetails(&sv.ExecutionTimedOutEventDetails, value); err != nil {
return err
}
case "id":
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.Id = i64
}
case "lambdaFunctionFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionFailedEventDetails(&sv.LambdaFunctionFailedEventDetails, value); err != nil {
return err
}
case "lambdaFunctionScheduledEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionScheduledEventDetails(&sv.LambdaFunctionScheduledEventDetails, value); err != nil {
return err
}
case "lambdaFunctionScheduleFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionScheduleFailedEventDetails(&sv.LambdaFunctionScheduleFailedEventDetails, value); err != nil {
return err
}
case "lambdaFunctionStartFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionStartFailedEventDetails(&sv.LambdaFunctionStartFailedEventDetails, value); err != nil {
return err
}
case "lambdaFunctionSucceededEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionSucceededEventDetails(&sv.LambdaFunctionSucceededEventDetails, value); err != nil {
return err
}
case "lambdaFunctionTimedOutEventDetails":
if err := awsAwsjson10_deserializeDocumentLambdaFunctionTimedOutEventDetails(&sv.LambdaFunctionTimedOutEventDetails, value); err != nil {
return err
}
case "mapIterationAbortedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapIterationEventDetails(&sv.MapIterationAbortedEventDetails, value); err != nil {
return err
}
case "mapIterationFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapIterationEventDetails(&sv.MapIterationFailedEventDetails, value); err != nil {
return err
}
case "mapIterationStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapIterationEventDetails(&sv.MapIterationStartedEventDetails, value); err != nil {
return err
}
case "mapIterationSucceededEventDetails":
if err := awsAwsjson10_deserializeDocumentMapIterationEventDetails(&sv.MapIterationSucceededEventDetails, value); err != nil {
return err
}
case "mapRunFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapRunFailedEventDetails(&sv.MapRunFailedEventDetails, value); err != nil {
return err
}
case "mapRunStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapRunStartedEventDetails(&sv.MapRunStartedEventDetails, value); err != nil {
return err
}
case "mapStateStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(&sv.MapStateStartedEventDetails, value); err != nil {
return err
}
case "previousEventId":
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.PreviousEventId = i64
}
case "stateEnteredEventDetails":
if err := awsAwsjson10_deserializeDocumentStateEnteredEventDetails(&sv.StateEnteredEventDetails, value); err != nil {
return err
}
case "stateExitedEventDetails":
if err := awsAwsjson10_deserializeDocumentStateExitedEventDetails(&sv.StateExitedEventDetails, value); err != nil {
return err
}
case "taskFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskFailedEventDetails(&sv.TaskFailedEventDetails, value); err != nil {
return err
}
case "taskScheduledEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskScheduledEventDetails(&sv.TaskScheduledEventDetails, value); err != nil {
return err
}
case "taskStartedEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskStartedEventDetails(&sv.TaskStartedEventDetails, value); err != nil {
return err
}
case "taskStartFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskStartFailedEventDetails(&sv.TaskStartFailedEventDetails, value); err != nil {
return err
}
case "taskSubmitFailedEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskSubmitFailedEventDetails(&sv.TaskSubmitFailedEventDetails, value); err != nil {
return err
}
case "taskSubmittedEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskSubmittedEventDetails(&sv.TaskSubmittedEventDetails, value); err != nil {
return err
}
case "taskSucceededEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskSucceededEventDetails(&sv.TaskSucceededEventDetails, value); err != nil {
return err
}
case "taskTimedOutEventDetails":
if err := awsAwsjson10_deserializeDocumentTaskTimedOutEventDetails(&sv.TaskTimedOutEventDetails, value); err != nil {
return err
}
case "timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HistoryEventType to be of type string, got %T instead", value)
}
sv.Type = types.HistoryEventType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(v **types.HistoryEventExecutionDataDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HistoryEventExecutionDataDetails
if *v == nil {
sv = &types.HistoryEventExecutionDataDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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_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_deserializeDocumentInvalidArn(v **types.InvalidArn, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidArn
if *v == nil {
sv = &types.InvalidArn{}
} 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_deserializeDocumentInvalidDefinition(v **types.InvalidDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidDefinition
if *v == nil {
sv = &types.InvalidDefinition{}
} 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_deserializeDocumentInvalidExecutionInput(v **types.InvalidExecutionInput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidExecutionInput
if *v == nil {
sv = &types.InvalidExecutionInput{}
} 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_deserializeDocumentInvalidLoggingConfiguration(v **types.InvalidLoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidLoggingConfiguration
if *v == nil {
sv = &types.InvalidLoggingConfiguration{}
} 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_deserializeDocumentInvalidName(v **types.InvalidName, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidName
if *v == nil {
sv = &types.InvalidName{}
} 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_deserializeDocumentInvalidOutput(v **types.InvalidOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidOutput
if *v == nil {
sv = &types.InvalidOutput{}
} 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_deserializeDocumentInvalidToken(v **types.InvalidToken, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidToken
if *v == nil {
sv = &types.InvalidToken{}
} 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_deserializeDocumentInvalidTracingConfiguration(v **types.InvalidTracingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidTracingConfiguration
if *v == nil {
sv = &types.InvalidTracingConfiguration{}
} 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_deserializeDocumentLambdaFunctionFailedEventDetails(v **types.LambdaFunctionFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionFailedEventDetails
if *v == nil {
sv = &types.LambdaFunctionFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLambdaFunctionScheduledEventDetails(v **types.LambdaFunctionScheduledEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionScheduledEventDetails
if *v == nil {
sv = &types.LambdaFunctionScheduledEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "taskCredentials":
if err := awsAwsjson10_deserializeDocumentTaskCredentials(&sv.TaskCredentials, value); err != nil {
return err
}
case "timeoutInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutInSeconds = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLambdaFunctionScheduleFailedEventDetails(v **types.LambdaFunctionScheduleFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionScheduleFailedEventDetails
if *v == nil {
sv = &types.LambdaFunctionScheduleFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLambdaFunctionStartFailedEventDetails(v **types.LambdaFunctionStartFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionStartFailedEventDetails
if *v == nil {
sv = &types.LambdaFunctionStartFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLambdaFunctionSucceededEventDetails(v **types.LambdaFunctionSucceededEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionSucceededEventDetails
if *v == nil {
sv = &types.LambdaFunctionSucceededEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLambdaFunctionTimedOutEventDetails(v **types.LambdaFunctionTimedOutEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaFunctionTimedOutEventDetails
if *v == nil {
sv = &types.LambdaFunctionTimedOutEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLogDestination(v **types.LogDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LogDestination
if *v == nil {
sv = &types.LogDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudWatchLogsLogGroup":
if err := awsAwsjson10_deserializeDocumentCloudWatchLogsLogGroup(&sv.CloudWatchLogsLogGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentLogDestinationList(v *[]types.LogDestination, 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.LogDestination
if *v == nil {
cv = []types.LogDestination{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LogDestination
destAddr := &col
if err := awsAwsjson10_deserializeDocumentLogDestination(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LoggingConfiguration
if *v == nil {
sv = &types.LoggingConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "destinations":
if err := awsAwsjson10_deserializeDocumentLogDestinationList(&sv.Destinations, value); err != nil {
return err
}
case "includeExecutionData":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected IncludeExecutionData to be of type *bool, got %T instead", value)
}
sv.IncludeExecutionData = jtv
}
case "level":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value)
}
sv.Level = types.LogLevel(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMapIterationEventDetails(v **types.MapIterationEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapIterationEventDetails
if *v == nil {
sv = &types.MapIterationEventDetails{}
} 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 UnsignedInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Index = int32(i64)
}
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_deserializeDocumentMapRunExecutionCounts(v **types.MapRunExecutionCounts, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapRunExecutionCounts
if *v == nil {
sv = &types.MapRunExecutionCounts{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "aborted":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Aborted = i64
}
case "failed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Failed = i64
}
case "pending":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Pending = i64
}
case "resultsWritten":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResultsWritten = i64
}
case "running":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Running = i64
}
case "succeeded":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Succeeded = i64
}
case "timedOut":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimedOut = i64
}
case "total":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Total = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMapRunFailedEventDetails(v **types.MapRunFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapRunFailedEventDetails
if *v == nil {
sv = &types.MapRunFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMapRunItemCounts(v **types.MapRunItemCounts, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapRunItemCounts
if *v == nil {
sv = &types.MapRunItemCounts{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "aborted":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Aborted = i64
}
case "failed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Failed = i64
}
case "pending":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Pending = i64
}
case "resultsWritten":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResultsWritten = i64
}
case "running":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Running = i64
}
case "succeeded":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Succeeded = i64
}
case "timedOut":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimedOut = i64
}
case "total":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Total = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMapRunList(v *[]types.MapRunListItem, 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.MapRunListItem
if *v == nil {
cv = []types.MapRunListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MapRunListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentMapRunListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentMapRunListItem(v **types.MapRunListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapRunListItem
if *v == nil {
sv = &types.MapRunListItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
case "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = 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 awsAwsjson10_deserializeDocumentMapRunStartedEventDetails(v **types.MapRunStartedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapRunStartedEventDetails
if *v == nil {
sv = &types.MapRunStartedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(v **types.MapStateStartedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapStateStartedEventDetails
if *v == nil {
sv = &types.MapStateStartedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "length":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected UnsignedInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Length = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentMissingRequiredParameter(v **types.MissingRequiredParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MissingRequiredParameter
if *v == nil {
sv = &types.MissingRequiredParameter{}
} 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_deserializeDocumentResourceNotFound(v **types.ResourceNotFound, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFound
if *v == nil {
sv = &types.ResourceNotFound{}
} 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)
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentRoutingConfigurationList(v *[]types.RoutingConfigurationListItem, 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.RoutingConfigurationListItem
if *v == nil {
cv = []types.RoutingConfigurationListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RoutingConfigurationListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentRoutingConfigurationListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentRoutingConfigurationListItem(v **types.RoutingConfigurationListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RoutingConfigurationListItem
if *v == nil {
sv = &types.RoutingConfigurationListItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
case "weight":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected VersionWeight to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Weight = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_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 awsAwsjson10_deserializeDocumentStateEnteredEventDetails(v **types.StateEnteredEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateEnteredEventDetails
if *v == nil {
sv = &types.StateEnteredEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
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_deserializeDocumentStateExitedEventDetails(v **types.StateExitedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateExitedEventDetails
if *v == nil {
sv = &types.StateExitedEventDetails{}
} 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 "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineAliasList(v *[]types.StateMachineAliasListItem, 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.StateMachineAliasListItem
if *v == nil {
cv = []types.StateMachineAliasListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StateMachineAliasListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentStateMachineAliasListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineAliasListItem(v **types.StateMachineAliasListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineAliasListItem
if *v == nil {
sv = &types.StateMachineAliasListItem{}
} 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 "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineAlreadyExists(v **types.StateMachineAlreadyExists, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineAlreadyExists
if *v == nil {
sv = &types.StateMachineAlreadyExists{}
} 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_deserializeDocumentStateMachineDeleting(v **types.StateMachineDeleting, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineDeleting
if *v == nil {
sv = &types.StateMachineDeleting{}
} 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_deserializeDocumentStateMachineDoesNotExist(v **types.StateMachineDoesNotExist, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineDoesNotExist
if *v == nil {
sv = &types.StateMachineDoesNotExist{}
} 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_deserializeDocumentStateMachineLimitExceeded(v **types.StateMachineLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineLimitExceeded
if *v == nil {
sv = &types.StateMachineLimitExceeded{}
} 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_deserializeDocumentStateMachineList(v *[]types.StateMachineListItem, 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.StateMachineListItem
if *v == nil {
cv = []types.StateMachineListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StateMachineListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentStateMachineListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineListItem(v **types.StateMachineListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineListItem
if *v == nil {
sv = &types.StateMachineListItem{}
} 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 "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 "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StateMachineType to be of type string, got %T instead", value)
}
sv.Type = types.StateMachineType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineTypeNotSupported(v **types.StateMachineTypeNotSupported, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineTypeNotSupported
if *v == nil {
sv = &types.StateMachineTypeNotSupported{}
} 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_deserializeDocumentStateMachineVersionList(v *[]types.StateMachineVersionListItem, 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.StateMachineVersionListItem
if *v == nil {
cv = []types.StateMachineVersionListItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StateMachineVersionListItem
destAddr := &col
if err := awsAwsjson10_deserializeDocumentStateMachineVersionListItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentStateMachineVersionListItem(v **types.StateMachineVersionListItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StateMachineVersionListItem
if *v == nil {
sv = &types.StateMachineVersionListItem{}
} 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 "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson10_deserializeDocumentTaskCredentials(v **types.TaskCredentials, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskCredentials
if *v == nil {
sv = &types.TaskCredentials{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskDoesNotExist(v **types.TaskDoesNotExist, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskDoesNotExist
if *v == nil {
sv = &types.TaskDoesNotExist{}
} 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_deserializeDocumentTaskFailedEventDetails(v **types.TaskFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskFailedEventDetails
if *v == nil {
sv = &types.TaskFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskScheduledEventDetails(v **types.TaskScheduledEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskScheduledEventDetails
if *v == nil {
sv = &types.TaskScheduledEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "heartbeatInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.HeartbeatInSeconds = ptr.Int64(i64)
}
case "parameters":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConnectorParameters to be of type string, got %T instead", value)
}
sv.Parameters = ptr.String(jtv)
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
case "taskCredentials":
if err := awsAwsjson10_deserializeDocumentTaskCredentials(&sv.TaskCredentials, value); err != nil {
return err
}
case "timeoutInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutInSeconds = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskStartedEventDetails(v **types.TaskStartedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskStartedEventDetails
if *v == nil {
sv = &types.TaskStartedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskStartFailedEventDetails(v **types.TaskStartFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskStartFailedEventDetails
if *v == nil {
sv = &types.TaskStartFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskSubmitFailedEventDetails(v **types.TaskSubmitFailedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskSubmitFailedEventDetails
if *v == nil {
sv = &types.TaskSubmitFailedEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskSubmittedEventDetails(v **types.TaskSubmittedEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskSubmittedEventDetails
if *v == nil {
sv = &types.TaskSubmittedEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskSucceededEventDetails(v **types.TaskSucceededEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskSucceededEventDetails
if *v == nil {
sv = &types.TaskSucceededEventDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentHistoryEventExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTaskTimedOut(v **types.TaskTimedOut, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskTimedOut
if *v == nil {
sv = &types.TaskTimedOut{}
} 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_deserializeDocumentTaskTimedOutEventDetails(v **types.TaskTimedOutEventDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TaskTimedOutEventDetails
if *v == nil {
sv = &types.TaskTimedOutEventDetails{}
} 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 SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTooManyTags(v **types.TooManyTags, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TooManyTags
if *v == nil {
sv = &types.TooManyTags{}
} 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)
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentTracingConfiguration(v **types.TracingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TracingConfiguration
if *v == nil {
sv = &types.TracingConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.Enabled = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value)
}
sv.Reason = types.ValidationExceptionReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentCreateActivityOutput(v **CreateActivityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateActivityOutput
if *v == nil {
sv = &CreateActivityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activityArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ActivityArn = ptr.String(jtv)
}
case "creationDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentCreateStateMachineAliasOutput(v **CreateStateMachineAliasOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateStateMachineAliasOutput
if *v == nil {
sv = &CreateStateMachineAliasOutput{}
} 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 "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentCreateStateMachineOutput(v **CreateStateMachineOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateStateMachineOutput
if *v == nil {
sv = &CreateStateMachineOutput{}
} 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 "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDeleteActivityOutput(v **DeleteActivityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteActivityOutput
if *v == nil {
sv = &DeleteActivityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDeleteStateMachineAliasOutput(v **DeleteStateMachineAliasOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteStateMachineAliasOutput
if *v == nil {
sv = &DeleteStateMachineAliasOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDeleteStateMachineOutput(v **DeleteStateMachineOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteStateMachineOutput
if *v == nil {
sv = &DeleteStateMachineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDeleteStateMachineVersionOutput(v **DeleteStateMachineVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteStateMachineVersionOutput
if *v == nil {
sv = &DeleteStateMachineVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDescribeActivityOutput(v **DescribeActivityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeActivityOutput
if *v == nil {
sv = &DescribeActivityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activityArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ActivityArn = ptr.String(jtv)
}
case "creationDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "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_deserializeOpDocumentDescribeExecutionOutput(v **DescribeExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeExecutionOutput
if *v == nil {
sv = &DescribeExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cause":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentCloudWatchEventsExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
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 "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentCloudWatchEventsExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
case "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.ExecutionStatus(jtv)
}
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "traceHeader":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TraceHeader to be of type string, got %T instead", value)
}
sv.TraceHeader = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDescribeMapRunOutput(v **DescribeMapRunOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeMapRunOutput
if *v == nil {
sv = &DescribeMapRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "executionCounts":
if err := awsAwsjson10_deserializeDocumentMapRunExecutionCounts(&sv.ExecutionCounts, value); err != nil {
return err
}
case "itemCounts":
if err := awsAwsjson10_deserializeDocumentMapRunItemCounts(&sv.ItemCounts, value); err != nil {
return err
}
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
case "maxConcurrency":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxConcurrency to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxConcurrency = int32(i64)
}
case "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapRunStatus to be of type string, got %T instead", value)
}
sv.Status = types.MapRunStatus(jtv)
}
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "toleratedFailureCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ToleratedFailureCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ToleratedFailureCount = i64
}
case "toleratedFailurePercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ToleratedFailurePercentage = 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.ToleratedFailurePercentage = float32(f64)
default:
return fmt.Errorf("expected ToleratedFailurePercentage to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentDescribeStateMachineAliasOutput(v **DescribeStateMachineAliasOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStateMachineAliasOutput
if *v == nil {
sv = &DescribeStateMachineAliasOutput{}
} 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 "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasDescription 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 Name to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "routingConfiguration":
if err := awsAwsjson10_deserializeDocumentRoutingConfigurationList(&sv.RoutingConfiguration, value); err != nil {
return err
}
case "stateMachineAliasArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineAliasArn = ptr.String(jtv)
}
case "updateDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdateDate = 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 awsAwsjson10_deserializeOpDocumentDescribeStateMachineForExecutionOutput(v **DescribeStateMachineForExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStateMachineForExecutionOutput
if *v == nil {
sv = &DescribeStateMachineForExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "definition":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Definition to be of type string, got %T instead", value)
}
sv.Definition = ptr.String(jtv)
}
case "label":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapRunLabel to be of type string, got %T instead", value)
}
sv.Label = ptr.String(jtv)
}
case "loggingConfiguration":
if err := awsAwsjson10_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
case "mapRunArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LongArn to be of type string, got %T instead", value)
}
sv.MapRunArn = ptr.String(jtv)
}
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 "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RevisionId to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "tracingConfiguration":
if err := awsAwsjson10_deserializeDocumentTracingConfiguration(&sv.TracingConfiguration, value); err != nil {
return err
}
case "updateDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdateDate = 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 awsAwsjson10_deserializeOpDocumentDescribeStateMachineOutput(v **DescribeStateMachineOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStateMachineOutput
if *v == nil {
sv = &DescribeStateMachineOutput{}
} 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 "definition":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Definition to be of type string, got %T instead", value)
}
sv.Definition = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "label":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapRunLabel to be of type string, got %T instead", value)
}
sv.Label = ptr.String(jtv)
}
case "loggingConfiguration":
if err := awsAwsjson10_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
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 "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RevisionId to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StateMachineStatus to be of type string, got %T instead", value)
}
sv.Status = types.StateMachineStatus(jtv)
}
case "tracingConfiguration":
if err := awsAwsjson10_deserializeDocumentTracingConfiguration(&sv.TracingConfiguration, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StateMachineType to be of type string, got %T instead", value)
}
sv.Type = types.StateMachineType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentGetActivityTaskOutput(v **GetActivityTaskOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetActivityTaskOutput
if *v == nil {
sv = &GetActivityTaskOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveDataJobInput to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentGetExecutionHistoryOutput(v **GetExecutionHistoryOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetExecutionHistoryOutput
if *v == nil {
sv = &GetExecutionHistoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "events":
if err := awsAwsjson10_deserializeDocumentHistoryEventList(&sv.Events, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListActivitiesOutput(v **ListActivitiesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListActivitiesOutput
if *v == nil {
sv = &ListActivitiesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activities":
if err := awsAwsjson10_deserializeDocumentActivityList(&sv.Activities, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListExecutionsOutput(v **ListExecutionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListExecutionsOutput
if *v == nil {
sv = &ListExecutionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "executions":
if err := awsAwsjson10_deserializeDocumentExecutionList(&sv.Executions, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ListExecutionsPageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListMapRunsOutput(v **ListMapRunsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListMapRunsOutput
if *v == nil {
sv = &ListMapRunsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "mapRuns":
if err := awsAwsjson10_deserializeDocumentMapRunList(&sv.MapRuns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListStateMachineAliasesOutput(v **ListStateMachineAliasesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStateMachineAliasesOutput
if *v == nil {
sv = &ListStateMachineAliasesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "stateMachineAliases":
if err := awsAwsjson10_deserializeDocumentStateMachineAliasList(&sv.StateMachineAliases, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListStateMachinesOutput(v **ListStateMachinesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStateMachinesOutput
if *v == nil {
sv = &ListStateMachinesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "stateMachines":
if err := awsAwsjson10_deserializeDocumentStateMachineList(&sv.StateMachines, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentListStateMachineVersionsOutput(v **ListStateMachineVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStateMachineVersionsOutput
if *v == nil {
sv = &ListStateMachineVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PageToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "stateMachineVersions":
if err := awsAwsjson10_deserializeDocumentStateMachineVersionList(&sv.StateMachineVersions, value); err != nil {
return err
}
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_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentPublishStateMachineVersionOutput(v **PublishStateMachineVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PublishStateMachineVersionOutput
if *v == nil {
sv = &PublishStateMachineVersionOutput{}
} 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 "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentSendTaskFailureOutput(v **SendTaskFailureOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendTaskFailureOutput
if *v == nil {
sv = &SendTaskFailureOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentSendTaskHeartbeatOutput(v **SendTaskHeartbeatOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendTaskHeartbeatOutput
if *v == nil {
sv = &SendTaskHeartbeatOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentSendTaskSuccessOutput(v **SendTaskSuccessOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendTaskSuccessOutput
if *v == nil {
sv = &SendTaskSuccessOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentStartExecutionOutput(v **StartExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartExecutionOutput
if *v == nil {
sv = &StartExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = 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 awsAwsjson10_deserializeOpDocumentStartSyncExecutionOutput(v **StartSyncExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartSyncExecutionOutput
if *v == nil {
sv = &StartSyncExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "billingDetails":
if err := awsAwsjson10_deserializeDocumentBillingDetails(&sv.BillingDetails, value); err != nil {
return err
}
case "cause":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveCause to be of type string, got %T instead", value)
}
sv.Cause = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "executionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ExecutionArn = ptr.String(jtv)
}
case "input":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Input = ptr.String(jtv)
}
case "inputDetails":
if err := awsAwsjson10_deserializeDocumentCloudWatchEventsExecutionDataDetails(&sv.InputDetails, value); err != nil {
return err
}
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 "output":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value)
}
sv.Output = ptr.String(jtv)
}
case "outputDetails":
if err := awsAwsjson10_deserializeDocumentCloudWatchEventsExecutionDataDetails(&sv.OutputDetails, value); err != nil {
return err
}
case "startDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "stateMachineArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineArn = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SyncExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.SyncExecutionStatus(jtv)
}
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "traceHeader":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TraceHeader to be of type string, got %T instead", value)
}
sv.TraceHeader = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentStopExecutionOutput(v **StopExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StopExecutionOutput
if *v == nil {
sv = &StopExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "stopDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StopDate = 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 awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentUpdateMapRunOutput(v **UpdateMapRunOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateMapRunOutput
if *v == nil {
sv = &UpdateMapRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson10_deserializeOpDocumentUpdateStateMachineAliasOutput(v **UpdateStateMachineAliasOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateStateMachineAliasOutput
if *v == nil {
sv = &UpdateStateMachineAliasOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "updateDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdateDate = 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 awsAwsjson10_deserializeOpDocumentUpdateStateMachineOutput(v **UpdateStateMachineOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateStateMachineOutput
if *v == nil {
sv = &UpdateStateMachineOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RevisionId to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
case "stateMachineVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.StateMachineVersionArn = ptr.String(jtv)
}
case "updateDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdateDate = 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
}
| 11,718 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package sfn provides the API client, operations, and parameter types for AWS
// Step Functions.
//
// Step Functions Step Functions is a service that lets you coordinate the
// components of distributed applications and microservices using visual workflows.
// You can use Step Functions to build applications from individual components,
// each of which performs a discrete function, or task, allowing you to scale and
// change applications quickly. Step Functions provides a console that helps
// visualize the components of your application as a series of steps. Step
// Functions automatically triggers and tracks each step, and retries steps when
// there are errors, so your application executes predictably and in the right
// order every time. Step Functions logs the state of each step, so you can quickly
// diagnose and debug any issues. Step Functions manages operations and underlying
// infrastructure to ensure your application is available at any scale. You can run
// tasks on Amazon Web Services, your own servers, or any system that has access to
// Amazon Web Services. You can access and use Step Functions using the console,
// the Amazon Web Services SDKs, or an HTTP API. For more information about Step
// Functions, see the Step Functions Developer Guide (https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html)
// .
package sfn
| 23 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/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 = "states"
}
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 sfn
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.0"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/sfn/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"
"math"
"path"
)
type awsAwsjson10_serializeOpCreateActivity struct {
}
func (*awsAwsjson10_serializeOpCreateActivity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpCreateActivity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateActivityInput)
_ = 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("AWSStepFunctions.CreateActivity")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentCreateActivityInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateStateMachine struct {
}
func (*awsAwsjson10_serializeOpCreateStateMachine) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpCreateStateMachine) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStateMachineInput)
_ = 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("AWSStepFunctions.CreateStateMachine")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentCreateStateMachineInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateStateMachineAlias struct {
}
func (*awsAwsjson10_serializeOpCreateStateMachineAlias) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpCreateStateMachineAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStateMachineAliasInput)
_ = 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("AWSStepFunctions.CreateStateMachineAlias")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentCreateStateMachineAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteActivity struct {
}
func (*awsAwsjson10_serializeOpDeleteActivity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDeleteActivity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteActivityInput)
_ = 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("AWSStepFunctions.DeleteActivity")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDeleteActivityInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteStateMachine struct {
}
func (*awsAwsjson10_serializeOpDeleteStateMachine) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDeleteStateMachine) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStateMachineInput)
_ = 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("AWSStepFunctions.DeleteStateMachine")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDeleteStateMachineInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteStateMachineAlias struct {
}
func (*awsAwsjson10_serializeOpDeleteStateMachineAlias) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDeleteStateMachineAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStateMachineAliasInput)
_ = 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("AWSStepFunctions.DeleteStateMachineAlias")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDeleteStateMachineAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteStateMachineVersion struct {
}
func (*awsAwsjson10_serializeOpDeleteStateMachineVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDeleteStateMachineVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStateMachineVersionInput)
_ = 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("AWSStepFunctions.DeleteStateMachineVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDeleteStateMachineVersionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeActivity struct {
}
func (*awsAwsjson10_serializeOpDescribeActivity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeActivity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeActivityInput)
_ = 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("AWSStepFunctions.DescribeActivity")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeActivityInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeExecution struct {
}
func (*awsAwsjson10_serializeOpDescribeExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSStepFunctions.DescribeExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson10_serializeOpDescribeMapRun struct {
}
func (*awsAwsjson10_serializeOpDescribeMapRun) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeMapRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeMapRunInput)
_ = 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("AWSStepFunctions.DescribeMapRun")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeMapRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeStateMachine struct {
}
func (*awsAwsjson10_serializeOpDescribeStateMachine) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeStateMachine) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStateMachineInput)
_ = 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("AWSStepFunctions.DescribeStateMachine")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeStateMachineInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeStateMachineAlias struct {
}
func (*awsAwsjson10_serializeOpDescribeStateMachineAlias) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeStateMachineAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStateMachineAliasInput)
_ = 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("AWSStepFunctions.DescribeStateMachineAlias")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeStateMachineAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeStateMachineForExecution struct {
}
func (*awsAwsjson10_serializeOpDescribeStateMachineForExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpDescribeStateMachineForExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStateMachineForExecutionInput)
_ = 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("AWSStepFunctions.DescribeStateMachineForExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentDescribeStateMachineForExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetActivityTask struct {
}
func (*awsAwsjson10_serializeOpGetActivityTask) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpGetActivityTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetActivityTaskInput)
_ = 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("AWSStepFunctions.GetActivityTask")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentGetActivityTaskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetExecutionHistory struct {
}
func (*awsAwsjson10_serializeOpGetExecutionHistory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpGetExecutionHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetExecutionHistoryInput)
_ = 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("AWSStepFunctions.GetExecutionHistory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentGetExecutionHistoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListActivities struct {
}
func (*awsAwsjson10_serializeOpListActivities) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListActivities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListActivitiesInput)
_ = 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("AWSStepFunctions.ListActivities")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListActivitiesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListExecutions struct {
}
func (*awsAwsjson10_serializeOpListExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSStepFunctions.ListExecutions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListExecutionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson10_serializeOpListMapRuns struct {
}
func (*awsAwsjson10_serializeOpListMapRuns) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListMapRuns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListMapRunsInput)
_ = 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("AWSStepFunctions.ListMapRuns")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListMapRunsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListStateMachineAliases struct {
}
func (*awsAwsjson10_serializeOpListStateMachineAliases) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListStateMachineAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStateMachineAliasesInput)
_ = 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("AWSStepFunctions.ListStateMachineAliases")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListStateMachineAliasesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListStateMachines struct {
}
func (*awsAwsjson10_serializeOpListStateMachines) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListStateMachines) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStateMachinesInput)
_ = 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("AWSStepFunctions.ListStateMachines")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListStateMachinesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListStateMachineVersions struct {
}
func (*awsAwsjson10_serializeOpListStateMachineVersions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpListStateMachineVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStateMachineVersionsInput)
_ = 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("AWSStepFunctions.ListStateMachineVersions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentListStateMachineVersionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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("AWSStepFunctions.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_serializeOpPublishStateMachineVersion struct {
}
func (*awsAwsjson10_serializeOpPublishStateMachineVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpPublishStateMachineVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PublishStateMachineVersionInput)
_ = 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("AWSStepFunctions.PublishStateMachineVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentPublishStateMachineVersionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSendTaskFailure struct {
}
func (*awsAwsjson10_serializeOpSendTaskFailure) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpSendTaskFailure) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SendTaskFailureInput)
_ = 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("AWSStepFunctions.SendTaskFailure")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentSendTaskFailureInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSendTaskHeartbeat struct {
}
func (*awsAwsjson10_serializeOpSendTaskHeartbeat) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpSendTaskHeartbeat) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SendTaskHeartbeatInput)
_ = 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("AWSStepFunctions.SendTaskHeartbeat")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentSendTaskHeartbeatInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSendTaskSuccess struct {
}
func (*awsAwsjson10_serializeOpSendTaskSuccess) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpSendTaskSuccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SendTaskSuccessInput)
_ = 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("AWSStepFunctions.SendTaskSuccess")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentSendTaskSuccessInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStartExecution struct {
}
func (*awsAwsjson10_serializeOpStartExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpStartExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartExecutionInput)
_ = 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("AWSStepFunctions.StartExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentStartExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStartSyncExecution struct {
}
func (*awsAwsjson10_serializeOpStartSyncExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpStartSyncExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartSyncExecutionInput)
_ = 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("AWSStepFunctions.StartSyncExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentStartSyncExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStopExecution struct {
}
func (*awsAwsjson10_serializeOpStopExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpStopExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopExecutionInput)
_ = 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("AWSStepFunctions.StopExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentStopExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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("AWSStepFunctions.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_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("AWSStepFunctions.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)
}
type awsAwsjson10_serializeOpUpdateMapRun struct {
}
func (*awsAwsjson10_serializeOpUpdateMapRun) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpUpdateMapRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateMapRunInput)
_ = 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("AWSStepFunctions.UpdateMapRun")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentUpdateMapRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateStateMachine struct {
}
func (*awsAwsjson10_serializeOpUpdateStateMachine) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpUpdateStateMachine) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateStateMachineInput)
_ = 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("AWSStepFunctions.UpdateStateMachine")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentUpdateStateMachineInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateStateMachineAlias struct {
}
func (*awsAwsjson10_serializeOpUpdateStateMachineAlias) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson10_serializeOpUpdateStateMachineAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateStateMachineAliasInput)
_ = 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("AWSStepFunctions.UpdateStateMachineAlias")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson10_serializeOpDocumentUpdateStateMachineAliasInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeDocumentCloudWatchLogsLogGroup(v *types.CloudWatchLogsLogGroup, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogGroupArn != nil {
ok := object.Key("logGroupArn")
ok.String(*v.LogGroupArn)
}
return nil
}
func awsAwsjson10_serializeDocumentLogDestination(v *types.LogDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLogsLogGroup != nil {
ok := object.Key("cloudWatchLogsLogGroup")
if err := awsAwsjson10_serializeDocumentCloudWatchLogsLogGroup(v.CloudWatchLogsLogGroup, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeDocumentLogDestinationList(v []types.LogDestination, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson10_serializeDocumentLogDestination(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeDocumentLoggingConfiguration(v *types.LoggingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destinations != nil {
ok := object.Key("destinations")
if err := awsAwsjson10_serializeDocumentLogDestinationList(v.Destinations, ok); err != nil {
return err
}
}
if v.IncludeExecutionData {
ok := object.Key("includeExecutionData")
ok.Boolean(v.IncludeExecutionData)
}
if len(v.Level) > 0 {
ok := object.Key("level")
ok.String(string(v.Level))
}
return nil
}
func awsAwsjson10_serializeDocumentRoutingConfigurationList(v []types.RoutingConfigurationListItem, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson10_serializeDocumentRoutingConfigurationListItem(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeDocumentRoutingConfigurationListItem(v *types.RoutingConfigurationListItem, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineVersionArn != nil {
ok := object.Key("stateMachineVersionArn")
ok.String(*v.StateMachineVersionArn)
}
{
ok := object.Key("weight")
ok.Integer(v.Weight)
}
return nil
}
func awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson10_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson10_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson10_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeDocumentTracingConfiguration(v *types.TracingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Enabled {
ok := object.Key("enabled")
ok.Boolean(v.Enabled)
}
return nil
}
func awsAwsjson10_serializeOpDocumentCreateActivityInput(v *CreateActivityInput, 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 := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeOpDocumentCreateStateMachineAliasInput(v *CreateStateMachineAliasInput, 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.RoutingConfiguration != nil {
ok := object.Key("routingConfiguration")
if err := awsAwsjson10_serializeDocumentRoutingConfigurationList(v.RoutingConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeOpDocumentCreateStateMachineInput(v *CreateStateMachineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Definition != nil {
ok := object.Key("definition")
ok.String(*v.Definition)
}
if v.LoggingConfiguration != nil {
ok := object.Key("loggingConfiguration")
if err := awsAwsjson10_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Publish {
ok := object.Key("publish")
ok.Boolean(v.Publish)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.TracingConfiguration != nil {
ok := object.Key("tracingConfiguration")
if err := awsAwsjson10_serializeDocumentTracingConfiguration(v.TracingConfiguration, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
if v.VersionDescription != nil {
ok := object.Key("versionDescription")
ok.String(*v.VersionDescription)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDeleteActivityInput(v *DeleteActivityInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActivityArn != nil {
ok := object.Key("activityArn")
ok.String(*v.ActivityArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDeleteStateMachineAliasInput(v *DeleteStateMachineAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineAliasArn != nil {
ok := object.Key("stateMachineAliasArn")
ok.String(*v.StateMachineAliasArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDeleteStateMachineInput(v *DeleteStateMachineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDeleteStateMachineVersionInput(v *DeleteStateMachineVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineVersionArn != nil {
ok := object.Key("stateMachineVersionArn")
ok.String(*v.StateMachineVersionArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeActivityInput(v *DescribeActivityInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActivityArn != nil {
ok := object.Key("activityArn")
ok.String(*v.ActivityArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeExecutionInput(v *DescribeExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionArn != nil {
ok := object.Key("executionArn")
ok.String(*v.ExecutionArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeMapRunInput(v *DescribeMapRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MapRunArn != nil {
ok := object.Key("mapRunArn")
ok.String(*v.MapRunArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeStateMachineAliasInput(v *DescribeStateMachineAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineAliasArn != nil {
ok := object.Key("stateMachineAliasArn")
ok.String(*v.StateMachineAliasArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeStateMachineForExecutionInput(v *DescribeStateMachineForExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionArn != nil {
ok := object.Key("executionArn")
ok.String(*v.ExecutionArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentDescribeStateMachineInput(v *DescribeStateMachineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentGetActivityTaskInput(v *GetActivityTaskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActivityArn != nil {
ok := object.Key("activityArn")
ok.String(*v.ActivityArn)
}
if v.WorkerName != nil {
ok := object.Key("workerName")
ok.String(*v.WorkerName)
}
return nil
}
func awsAwsjson10_serializeOpDocumentGetExecutionHistoryInput(v *GetExecutionHistoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionArn != nil {
ok := object.Key("executionArn")
ok.String(*v.ExecutionArn)
}
if v.IncludeExecutionData != nil {
ok := object.Key("includeExecutionData")
ok.Boolean(*v.IncludeExecutionData)
}
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ReverseOrder {
ok := object.Key("reverseOrder")
ok.Boolean(v.ReverseOrder)
}
return nil
}
func awsAwsjson10_serializeOpDocumentListActivitiesInput(v *ListActivitiesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentListExecutionsInput(v *ListExecutionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MapRunArn != nil {
ok := object.Key("mapRunArn")
ok.String(*v.MapRunArn)
}
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
if len(v.StatusFilter) > 0 {
ok := object.Key("statusFilter")
ok.String(string(v.StatusFilter))
}
return nil
}
func awsAwsjson10_serializeOpDocumentListMapRunsInput(v *ListMapRunsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionArn != nil {
ok := object.Key("executionArn")
ok.String(*v.ExecutionArn)
}
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentListStateMachineAliasesInput(v *ListStateMachineAliasesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentListStateMachinesInput(v *ListStateMachinesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentListStateMachineVersionsInput(v *ListStateMachineVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != 0 {
ok := object.Key("maxResults")
ok.Integer(v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
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_serializeOpDocumentPublishStateMachineVersionInput(v *PublishStateMachineVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.RevisionId != nil {
ok := object.Key("revisionId")
ok.String(*v.RevisionId)
}
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentSendTaskFailureInput(v *SendTaskFailureInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Cause != nil {
ok := object.Key("cause")
ok.String(*v.Cause)
}
if v.Error != nil {
ok := object.Key("error")
ok.String(*v.Error)
}
if v.TaskToken != nil {
ok := object.Key("taskToken")
ok.String(*v.TaskToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentSendTaskHeartbeatInput(v *SendTaskHeartbeatInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TaskToken != nil {
ok := object.Key("taskToken")
ok.String(*v.TaskToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentSendTaskSuccessInput(v *SendTaskSuccessInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Output != nil {
ok := object.Key("output")
ok.String(*v.Output)
}
if v.TaskToken != nil {
ok := object.Key("taskToken")
ok.String(*v.TaskToken)
}
return nil
}
func awsAwsjson10_serializeOpDocumentStartExecutionInput(v *StartExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
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.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
if v.TraceHeader != nil {
ok := object.Key("traceHeader")
ok.String(*v.TraceHeader)
}
return nil
}
func awsAwsjson10_serializeOpDocumentStartSyncExecutionInput(v *StartSyncExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
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.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
if v.TraceHeader != nil {
ok := object.Key("traceHeader")
ok.String(*v.TraceHeader)
}
return nil
}
func awsAwsjson10_serializeOpDocumentStopExecutionInput(v *StopExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Cause != nil {
ok := object.Key("cause")
ok.String(*v.Cause)
}
if v.Error != nil {
ok := object.Key("error")
ok.String(*v.Error)
}
if v.ExecutionArn != nil {
ok := object.Key("executionArn")
ok.String(*v.ExecutionArn)
}
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_serializeDocumentTagList(v.Tags, 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_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson10_serializeOpDocumentUpdateMapRunInput(v *UpdateMapRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MapRunArn != nil {
ok := object.Key("mapRunArn")
ok.String(*v.MapRunArn)
}
if v.MaxConcurrency != nil {
ok := object.Key("maxConcurrency")
ok.Integer(*v.MaxConcurrency)
}
if v.ToleratedFailureCount != nil {
ok := object.Key("toleratedFailureCount")
ok.Long(*v.ToleratedFailureCount)
}
if v.ToleratedFailurePercentage != nil {
ok := object.Key("toleratedFailurePercentage")
switch {
case math.IsNaN(float64(*v.ToleratedFailurePercentage)):
ok.String("NaN")
case math.IsInf(float64(*v.ToleratedFailurePercentage), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.ToleratedFailurePercentage), -1):
ok.String("-Infinity")
default:
ok.Float(*v.ToleratedFailurePercentage)
}
}
return nil
}
func awsAwsjson10_serializeOpDocumentUpdateStateMachineAliasInput(v *UpdateStateMachineAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.RoutingConfiguration != nil {
ok := object.Key("routingConfiguration")
if err := awsAwsjson10_serializeDocumentRoutingConfigurationList(v.RoutingConfiguration, ok); err != nil {
return err
}
}
if v.StateMachineAliasArn != nil {
ok := object.Key("stateMachineAliasArn")
ok.String(*v.StateMachineAliasArn)
}
return nil
}
func awsAwsjson10_serializeOpDocumentUpdateStateMachineInput(v *UpdateStateMachineInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Definition != nil {
ok := object.Key("definition")
ok.String(*v.Definition)
}
if v.LoggingConfiguration != nil {
ok := object.Key("loggingConfiguration")
if err := awsAwsjson10_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil {
return err
}
}
if v.Publish {
ok := object.Key("publish")
ok.Boolean(v.Publish)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.StateMachineArn != nil {
ok := object.Key("stateMachineArn")
ok.String(*v.StateMachineArn)
}
if v.TracingConfiguration != nil {
ok := object.Key("tracingConfiguration")
if err := awsAwsjson10_serializeDocumentTracingConfiguration(v.TracingConfiguration, ok); err != nil {
return err
}
}
if v.VersionDescription != nil {
ok := object.Key("versionDescription")
ok.String(*v.VersionDescription)
}
return nil
}
| 2,744 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/sfn/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateActivity struct {
}
func (*validateOpCreateActivity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateActivity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateActivityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateActivityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStateMachineAlias struct {
}
func (*validateOpCreateStateMachineAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStateMachineAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStateMachineAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStateMachineAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStateMachine struct {
}
func (*validateOpCreateStateMachine) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStateMachine) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStateMachineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStateMachineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteActivity struct {
}
func (*validateOpDeleteActivity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteActivity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteActivityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteActivityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStateMachineAlias struct {
}
func (*validateOpDeleteStateMachineAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStateMachineAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStateMachineAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStateMachineAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStateMachine struct {
}
func (*validateOpDeleteStateMachine) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStateMachine) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStateMachineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStateMachineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStateMachineVersion struct {
}
func (*validateOpDeleteStateMachineVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStateMachineVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStateMachineVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStateMachineVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeActivity struct {
}
func (*validateOpDescribeActivity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeActivity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeActivityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeActivityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeExecution struct {
}
func (*validateOpDescribeExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeMapRun struct {
}
func (*validateOpDescribeMapRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeMapRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeMapRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeMapRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStateMachineAlias struct {
}
func (*validateOpDescribeStateMachineAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStateMachineAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStateMachineAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStateMachineAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStateMachineForExecution struct {
}
func (*validateOpDescribeStateMachineForExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStateMachineForExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStateMachineForExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStateMachineForExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStateMachine struct {
}
func (*validateOpDescribeStateMachine) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStateMachine) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStateMachineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStateMachineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetActivityTask struct {
}
func (*validateOpGetActivityTask) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetActivityTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetActivityTaskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetActivityTaskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExecutionHistory struct {
}
func (*validateOpGetExecutionHistory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExecutionHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExecutionHistoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExecutionHistoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListMapRuns struct {
}
func (*validateOpListMapRuns) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListMapRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListMapRunsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListMapRunsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListStateMachineAliases struct {
}
func (*validateOpListStateMachineAliases) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListStateMachineAliases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListStateMachineAliasesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListStateMachineAliasesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListStateMachineVersions struct {
}
func (*validateOpListStateMachineVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListStateMachineVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListStateMachineVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListStateMachineVersionsInput(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 validateOpPublishStateMachineVersion struct {
}
func (*validateOpPublishStateMachineVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPublishStateMachineVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PublishStateMachineVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPublishStateMachineVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendTaskFailure struct {
}
func (*validateOpSendTaskFailure) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendTaskFailure) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendTaskFailureInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendTaskFailureInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendTaskHeartbeat struct {
}
func (*validateOpSendTaskHeartbeat) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendTaskHeartbeat) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendTaskHeartbeatInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendTaskHeartbeatInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendTaskSuccess struct {
}
func (*validateOpSendTaskSuccess) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendTaskSuccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendTaskSuccessInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendTaskSuccessInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartExecution struct {
}
func (*validateOpStartExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartSyncExecution struct {
}
func (*validateOpStartSyncExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartSyncExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartSyncExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartSyncExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopExecution struct {
}
func (*validateOpStopExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopExecutionInput(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 validateOpUpdateMapRun struct {
}
func (*validateOpUpdateMapRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateMapRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateMapRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateMapRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStateMachineAlias struct {
}
func (*validateOpUpdateStateMachineAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStateMachineAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStateMachineAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStateMachineAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStateMachine struct {
}
func (*validateOpUpdateStateMachine) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStateMachine) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStateMachineInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStateMachineInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateActivityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateActivity{}, middleware.After)
}
func addOpCreateStateMachineAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStateMachineAlias{}, middleware.After)
}
func addOpCreateStateMachineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStateMachine{}, middleware.After)
}
func addOpDeleteActivityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteActivity{}, middleware.After)
}
func addOpDeleteStateMachineAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStateMachineAlias{}, middleware.After)
}
func addOpDeleteStateMachineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStateMachine{}, middleware.After)
}
func addOpDeleteStateMachineVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStateMachineVersion{}, middleware.After)
}
func addOpDescribeActivityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeActivity{}, middleware.After)
}
func addOpDescribeExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeExecution{}, middleware.After)
}
func addOpDescribeMapRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeMapRun{}, middleware.After)
}
func addOpDescribeStateMachineAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStateMachineAlias{}, middleware.After)
}
func addOpDescribeStateMachineForExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStateMachineForExecution{}, middleware.After)
}
func addOpDescribeStateMachineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStateMachine{}, middleware.After)
}
func addOpGetActivityTaskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetActivityTask{}, middleware.After)
}
func addOpGetExecutionHistoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExecutionHistory{}, middleware.After)
}
func addOpListMapRunsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListMapRuns{}, middleware.After)
}
func addOpListStateMachineAliasesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListStateMachineAliases{}, middleware.After)
}
func addOpListStateMachineVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListStateMachineVersions{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPublishStateMachineVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPublishStateMachineVersion{}, middleware.After)
}
func addOpSendTaskFailureValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendTaskFailure{}, middleware.After)
}
func addOpSendTaskHeartbeatValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendTaskHeartbeat{}, middleware.After)
}
func addOpSendTaskSuccessValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendTaskSuccess{}, middleware.After)
}
func addOpStartExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartExecution{}, middleware.After)
}
func addOpStartSyncExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartSyncExecution{}, middleware.After)
}
func addOpStopExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopExecution{}, 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 addOpUpdateMapRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateMapRun{}, middleware.After)
}
func addOpUpdateStateMachineAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStateMachineAlias{}, middleware.After)
}
func addOpUpdateStateMachineValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStateMachine{}, middleware.After)
}
func validateRoutingConfigurationList(v []types.RoutingConfigurationListItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RoutingConfigurationList"}
for i := range v {
if err := validateRoutingConfigurationListItem(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRoutingConfigurationListItem(v *types.RoutingConfigurationListItem) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RoutingConfigurationListItem"}
if v.StateMachineVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateActivityInput(v *CreateActivityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateActivityInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStateMachineAliasInput(v *CreateStateMachineAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStateMachineAliasInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.RoutingConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoutingConfiguration"))
} else if v.RoutingConfiguration != nil {
if err := validateRoutingConfigurationList(v.RoutingConfiguration); err != nil {
invalidParams.AddNested("RoutingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStateMachineInput(v *CreateStateMachineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStateMachineInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteActivityInput(v *DeleteActivityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteActivityInput"}
if v.ActivityArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivityArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStateMachineAliasInput(v *DeleteStateMachineAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStateMachineAliasInput"}
if v.StateMachineAliasArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineAliasArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStateMachineInput(v *DeleteStateMachineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStateMachineInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStateMachineVersionInput(v *DeleteStateMachineVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStateMachineVersionInput"}
if v.StateMachineVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineVersionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeActivityInput(v *DescribeActivityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeActivityInput"}
if v.ActivityArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivityArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeExecutionInput(v *DescribeExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeExecutionInput"}
if v.ExecutionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeMapRunInput(v *DescribeMapRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeMapRunInput"}
if v.MapRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStateMachineAliasInput(v *DescribeStateMachineAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStateMachineAliasInput"}
if v.StateMachineAliasArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineAliasArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStateMachineForExecutionInput(v *DescribeStateMachineForExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStateMachineForExecutionInput"}
if v.ExecutionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStateMachineInput(v *DescribeStateMachineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStateMachineInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetActivityTaskInput(v *GetActivityTaskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetActivityTaskInput"}
if v.ActivityArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivityArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExecutionHistoryInput(v *GetExecutionHistoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExecutionHistoryInput"}
if v.ExecutionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListMapRunsInput(v *ListMapRunsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListMapRunsInput"}
if v.ExecutionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListStateMachineAliasesInput(v *ListStateMachineAliasesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListStateMachineAliasesInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListStateMachineVersionsInput(v *ListStateMachineVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListStateMachineVersionsInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
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 validateOpPublishStateMachineVersionInput(v *PublishStateMachineVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PublishStateMachineVersionInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendTaskFailureInput(v *SendTaskFailureInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendTaskFailureInput"}
if v.TaskToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("TaskToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendTaskHeartbeatInput(v *SendTaskHeartbeatInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendTaskHeartbeatInput"}
if v.TaskToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("TaskToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendTaskSuccessInput(v *SendTaskSuccessInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendTaskSuccessInput"}
if v.TaskToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("TaskToken"))
}
if v.Output == nil {
invalidParams.Add(smithy.NewErrParamRequired("Output"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartExecutionInput(v *StartExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartExecutionInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartSyncExecutionInput(v *StartSyncExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartSyncExecutionInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopExecutionInput(v *StopExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopExecutionInput"}
if v.ExecutionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn"))
}
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 validateOpUpdateMapRunInput(v *UpdateMapRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateMapRunInput"}
if v.MapRunArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapRunArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStateMachineAliasInput(v *UpdateStateMachineAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStateMachineAliasInput"}
if v.StateMachineAliasArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineAliasArn"))
}
if v.RoutingConfiguration != nil {
if err := validateRoutingConfigurationList(v.RoutingConfiguration); err != nil {
invalidParams.AddNested("RoutingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStateMachineInput(v *UpdateStateMachineInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStateMachineInput"}
if v.StateMachineArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,280 |
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 SFN 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: "states.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "states-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-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: "states-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: "states-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: "states-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: "states-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "states.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "states-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "states-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "states-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "states.{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: "states-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: "states.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: "states-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: "states.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 ExecutionStatus string
// Enum values for ExecutionStatus
const (
ExecutionStatusRunning ExecutionStatus = "RUNNING"
ExecutionStatusSucceeded ExecutionStatus = "SUCCEEDED"
ExecutionStatusFailed ExecutionStatus = "FAILED"
ExecutionStatusTimedOut ExecutionStatus = "TIMED_OUT"
ExecutionStatusAborted ExecutionStatus = "ABORTED"
)
// 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{
"RUNNING",
"SUCCEEDED",
"FAILED",
"TIMED_OUT",
"ABORTED",
}
}
type HistoryEventType string
// Enum values for HistoryEventType
const (
HistoryEventTypeActivityFailed HistoryEventType = "ActivityFailed"
HistoryEventTypeActivityScheduled HistoryEventType = "ActivityScheduled"
HistoryEventTypeActivityScheduleFailed HistoryEventType = "ActivityScheduleFailed"
HistoryEventTypeActivityStarted HistoryEventType = "ActivityStarted"
HistoryEventTypeActivitySucceeded HistoryEventType = "ActivitySucceeded"
HistoryEventTypeActivityTimedOut HistoryEventType = "ActivityTimedOut"
HistoryEventTypeChoiceStateEntered HistoryEventType = "ChoiceStateEntered"
HistoryEventTypeChoiceStateExited HistoryEventType = "ChoiceStateExited"
HistoryEventTypeExecutionAborted HistoryEventType = "ExecutionAborted"
HistoryEventTypeExecutionFailed HistoryEventType = "ExecutionFailed"
HistoryEventTypeExecutionStarted HistoryEventType = "ExecutionStarted"
HistoryEventTypeExecutionSucceeded HistoryEventType = "ExecutionSucceeded"
HistoryEventTypeExecutionTimedOut HistoryEventType = "ExecutionTimedOut"
HistoryEventTypeFailStateEntered HistoryEventType = "FailStateEntered"
HistoryEventTypeLambdaFunctionFailed HistoryEventType = "LambdaFunctionFailed"
HistoryEventTypeLambdaFunctionScheduled HistoryEventType = "LambdaFunctionScheduled"
HistoryEventTypeLambdaFunctionScheduleFailed HistoryEventType = "LambdaFunctionScheduleFailed"
HistoryEventTypeLambdaFunctionStarted HistoryEventType = "LambdaFunctionStarted"
HistoryEventTypeLambdaFunctionStartFailed HistoryEventType = "LambdaFunctionStartFailed"
HistoryEventTypeLambdaFunctionSucceeded HistoryEventType = "LambdaFunctionSucceeded"
HistoryEventTypeLambdaFunctionTimedOut HistoryEventType = "LambdaFunctionTimedOut"
HistoryEventTypeMapIterationAborted HistoryEventType = "MapIterationAborted"
HistoryEventTypeMapIterationFailed HistoryEventType = "MapIterationFailed"
HistoryEventTypeMapIterationStarted HistoryEventType = "MapIterationStarted"
HistoryEventTypeMapIterationSucceeded HistoryEventType = "MapIterationSucceeded"
HistoryEventTypeMapStateAborted HistoryEventType = "MapStateAborted"
HistoryEventTypeMapStateEntered HistoryEventType = "MapStateEntered"
HistoryEventTypeMapStateExited HistoryEventType = "MapStateExited"
HistoryEventTypeMapStateFailed HistoryEventType = "MapStateFailed"
HistoryEventTypeMapStateStarted HistoryEventType = "MapStateStarted"
HistoryEventTypeMapStateSucceeded HistoryEventType = "MapStateSucceeded"
HistoryEventTypeParallelStateAborted HistoryEventType = "ParallelStateAborted"
HistoryEventTypeParallelStateEntered HistoryEventType = "ParallelStateEntered"
HistoryEventTypeParallelStateExited HistoryEventType = "ParallelStateExited"
HistoryEventTypeParallelStateFailed HistoryEventType = "ParallelStateFailed"
HistoryEventTypeParallelStateStarted HistoryEventType = "ParallelStateStarted"
HistoryEventTypeParallelStateSucceeded HistoryEventType = "ParallelStateSucceeded"
HistoryEventTypePassStateEntered HistoryEventType = "PassStateEntered"
HistoryEventTypePassStateExited HistoryEventType = "PassStateExited"
HistoryEventTypeSucceedStateEntered HistoryEventType = "SucceedStateEntered"
HistoryEventTypeSucceedStateExited HistoryEventType = "SucceedStateExited"
HistoryEventTypeTaskFailed HistoryEventType = "TaskFailed"
HistoryEventTypeTaskScheduled HistoryEventType = "TaskScheduled"
HistoryEventTypeTaskStarted HistoryEventType = "TaskStarted"
HistoryEventTypeTaskStartFailed HistoryEventType = "TaskStartFailed"
HistoryEventTypeTaskStateAborted HistoryEventType = "TaskStateAborted"
HistoryEventTypeTaskStateEntered HistoryEventType = "TaskStateEntered"
HistoryEventTypeTaskStateExited HistoryEventType = "TaskStateExited"
HistoryEventTypeTaskSubmitFailed HistoryEventType = "TaskSubmitFailed"
HistoryEventTypeTaskSubmitted HistoryEventType = "TaskSubmitted"
HistoryEventTypeTaskSucceeded HistoryEventType = "TaskSucceeded"
HistoryEventTypeTaskTimedOut HistoryEventType = "TaskTimedOut"
HistoryEventTypeWaitStateAborted HistoryEventType = "WaitStateAborted"
HistoryEventTypeWaitStateEntered HistoryEventType = "WaitStateEntered"
HistoryEventTypeWaitStateExited HistoryEventType = "WaitStateExited"
HistoryEventTypeMapRunAborted HistoryEventType = "MapRunAborted"
HistoryEventTypeMapRunFailed HistoryEventType = "MapRunFailed"
HistoryEventTypeMapRunStarted HistoryEventType = "MapRunStarted"
HistoryEventTypeMapRunSucceeded HistoryEventType = "MapRunSucceeded"
)
// Values returns all known values for HistoryEventType. 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 (HistoryEventType) Values() []HistoryEventType {
return []HistoryEventType{
"ActivityFailed",
"ActivityScheduled",
"ActivityScheduleFailed",
"ActivityStarted",
"ActivitySucceeded",
"ActivityTimedOut",
"ChoiceStateEntered",
"ChoiceStateExited",
"ExecutionAborted",
"ExecutionFailed",
"ExecutionStarted",
"ExecutionSucceeded",
"ExecutionTimedOut",
"FailStateEntered",
"LambdaFunctionFailed",
"LambdaFunctionScheduled",
"LambdaFunctionScheduleFailed",
"LambdaFunctionStarted",
"LambdaFunctionStartFailed",
"LambdaFunctionSucceeded",
"LambdaFunctionTimedOut",
"MapIterationAborted",
"MapIterationFailed",
"MapIterationStarted",
"MapIterationSucceeded",
"MapStateAborted",
"MapStateEntered",
"MapStateExited",
"MapStateFailed",
"MapStateStarted",
"MapStateSucceeded",
"ParallelStateAborted",
"ParallelStateEntered",
"ParallelStateExited",
"ParallelStateFailed",
"ParallelStateStarted",
"ParallelStateSucceeded",
"PassStateEntered",
"PassStateExited",
"SucceedStateEntered",
"SucceedStateExited",
"TaskFailed",
"TaskScheduled",
"TaskStarted",
"TaskStartFailed",
"TaskStateAborted",
"TaskStateEntered",
"TaskStateExited",
"TaskSubmitFailed",
"TaskSubmitted",
"TaskSucceeded",
"TaskTimedOut",
"WaitStateAborted",
"WaitStateEntered",
"WaitStateExited",
"MapRunAborted",
"MapRunFailed",
"MapRunStarted",
"MapRunSucceeded",
}
}
type LogLevel string
// Enum values for LogLevel
const (
LogLevelAll LogLevel = "ALL"
LogLevelError LogLevel = "ERROR"
LogLevelFatal LogLevel = "FATAL"
LogLevelOff LogLevel = "OFF"
)
// Values returns all known values for LogLevel. 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 (LogLevel) Values() []LogLevel {
return []LogLevel{
"ALL",
"ERROR",
"FATAL",
"OFF",
}
}
type MapRunStatus string
// Enum values for MapRunStatus
const (
MapRunStatusRunning MapRunStatus = "RUNNING"
MapRunStatusSucceeded MapRunStatus = "SUCCEEDED"
MapRunStatusFailed MapRunStatus = "FAILED"
MapRunStatusAborted MapRunStatus = "ABORTED"
)
// Values returns all known values for MapRunStatus. 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 (MapRunStatus) Values() []MapRunStatus {
return []MapRunStatus{
"RUNNING",
"SUCCEEDED",
"FAILED",
"ABORTED",
}
}
type StateMachineStatus string
// Enum values for StateMachineStatus
const (
StateMachineStatusActive StateMachineStatus = "ACTIVE"
StateMachineStatusDeleting StateMachineStatus = "DELETING"
)
// Values returns all known values for StateMachineStatus. 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 (StateMachineStatus) Values() []StateMachineStatus {
return []StateMachineStatus{
"ACTIVE",
"DELETING",
}
}
type StateMachineType string
// Enum values for StateMachineType
const (
StateMachineTypeStandard StateMachineType = "STANDARD"
StateMachineTypeExpress StateMachineType = "EXPRESS"
)
// Values returns all known values for StateMachineType. 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 (StateMachineType) Values() []StateMachineType {
return []StateMachineType{
"STANDARD",
"EXPRESS",
}
}
type SyncExecutionStatus string
// Enum values for SyncExecutionStatus
const (
SyncExecutionStatusSucceeded SyncExecutionStatus = "SUCCEEDED"
SyncExecutionStatusFailed SyncExecutionStatus = "FAILED"
SyncExecutionStatusTimedOut SyncExecutionStatus = "TIMED_OUT"
)
// Values returns all known values for SyncExecutionStatus. 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 (SyncExecutionStatus) Values() []SyncExecutionStatus {
return []SyncExecutionStatus{
"SUCCEEDED",
"FAILED",
"TIMED_OUT",
}
}
type ValidationExceptionReason string
// Enum values for ValidationExceptionReason
const (
ValidationExceptionReasonApiDoesNotSupportLabeledArns ValidationExceptionReason = "API_DOES_NOT_SUPPORT_LABELED_ARNS"
ValidationExceptionReasonMissingRequiredParameter ValidationExceptionReason = "MISSING_REQUIRED_PARAMETER"
ValidationExceptionReasonCannotUpdateCompletedMapRun ValidationExceptionReason = "CANNOT_UPDATE_COMPLETED_MAP_RUN"
ValidationExceptionReasonInvalidRoutingConfiguration ValidationExceptionReason = "INVALID_ROUTING_CONFIGURATION"
)
// Values returns all known values for ValidationExceptionReason. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ValidationExceptionReason) Values() []ValidationExceptionReason {
return []ValidationExceptionReason{
"API_DOES_NOT_SUPPORT_LABELED_ARNS",
"MISSING_REQUIRED_PARAMETER",
"CANNOT_UPDATE_COMPLETED_MAP_RUN",
"INVALID_ROUTING_CONFIGURATION",
}
}
| 282 |
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 specified activity does not exist.
type ActivityDoesNotExist struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ActivityDoesNotExist) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ActivityDoesNotExist) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ActivityDoesNotExist) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ActivityDoesNotExist"
}
return *e.ErrorCodeOverride
}
func (e *ActivityDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The maximum number of activities has been reached. Existing activities must be
// deleted before a new activity can be created.
type ActivityLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ActivityLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ActivityLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ActivityLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ActivityLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *ActivityLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The maximum number of workers concurrently polling for activity tasks has been
// reached.
type ActivityWorkerLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ActivityWorkerLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ActivityWorkerLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ActivityWorkerLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ActivityWorkerLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *ActivityWorkerLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Updating or deleting a resource can cause an inconsistent state. This error
// occurs when there're concurrent requests for DeleteStateMachineVersion ,
// PublishStateMachineVersion , or UpdateStateMachine with the publish parameter
// set to true . HTTP Status Code: 409
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The execution has the same name as another execution (but a different input ).
// Executions with the same name and input are considered idempotent.
type ExecutionAlreadyExists struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExecutionAlreadyExists) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExecutionAlreadyExists) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExecutionAlreadyExists) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExecutionAlreadyExists"
}
return *e.ErrorCodeOverride
}
func (e *ExecutionAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified execution does not exist.
type ExecutionDoesNotExist struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExecutionDoesNotExist) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExecutionDoesNotExist) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExecutionDoesNotExist) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExecutionDoesNotExist"
}
return *e.ErrorCodeOverride
}
func (e *ExecutionDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The maximum number of running executions has been reached. Running executions
// must end or be stopped before a new execution can be started.
type ExecutionLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExecutionLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExecutionLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExecutionLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExecutionLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *ExecutionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided Amazon Resource Name (ARN) is not valid.
type InvalidArn struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidArn) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidArn) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidArn) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidArn"
}
return *e.ErrorCodeOverride
}
func (e *InvalidArn) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided Amazon States Language definition is not valid.
type InvalidDefinition struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidDefinition) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidDefinition) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidDefinition) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidDefinition"
}
return *e.ErrorCodeOverride
}
func (e *InvalidDefinition) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided JSON input data is not valid.
type InvalidExecutionInput struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidExecutionInput) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidExecutionInput) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidExecutionInput) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidExecutionInput"
}
return *e.ErrorCodeOverride
}
func (e *InvalidExecutionInput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type InvalidLoggingConfiguration struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidLoggingConfiguration) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidLoggingConfiguration) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidLoggingConfiguration) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidLoggingConfiguration"
}
return *e.ErrorCodeOverride
}
func (e *InvalidLoggingConfiguration) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided name is not valid.
type InvalidName struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidName) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidName) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidName) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidName"
}
return *e.ErrorCodeOverride
}
func (e *InvalidName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided JSON output data is not valid.
type InvalidOutput struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidOutput) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidOutput) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidOutput) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidOutput"
}
return *e.ErrorCodeOverride
}
func (e *InvalidOutput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The provided token is not valid.
type InvalidToken struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidToken) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidToken) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidToken) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidToken"
}
return *e.ErrorCodeOverride
}
func (e *InvalidToken) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Your tracingConfiguration key does not match, or enabled has not been set to
// true or false .
type InvalidTracingConfiguration struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidTracingConfiguration) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidTracingConfiguration) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidTracingConfiguration) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidTracingConfiguration"
}
return *e.ErrorCodeOverride
}
func (e *InvalidTracingConfiguration) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Request is missing a required parameter. This error occurs if both definition
// and roleArn are not specified.
type MissingRequiredParameter struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *MissingRequiredParameter) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *MissingRequiredParameter) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *MissingRequiredParameter) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "MissingRequiredParameter"
}
return *e.ErrorCodeOverride
}
func (e *MissingRequiredParameter) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Could not find the referenced resource.
type ResourceNotFound struct {
Message *string
ErrorCodeOverride *string
ResourceName *string
noSmithyDocumentSerde
}
func (e *ResourceNotFound) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFound) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFound) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFound"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request would cause a service quota to be exceeded. HTTP Status Code: 402
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 }
// A state machine with the same name but a different definition or role ARN
// already exists.
type StateMachineAlreadyExists struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *StateMachineAlreadyExists) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *StateMachineAlreadyExists) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *StateMachineAlreadyExists) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "StateMachineAlreadyExists"
}
return *e.ErrorCodeOverride
}
func (e *StateMachineAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified state machine is being deleted.
type StateMachineDeleting struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *StateMachineDeleting) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *StateMachineDeleting) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *StateMachineDeleting) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "StateMachineDeleting"
}
return *e.ErrorCodeOverride
}
func (e *StateMachineDeleting) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified state machine does not exist.
type StateMachineDoesNotExist struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *StateMachineDoesNotExist) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *StateMachineDoesNotExist) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *StateMachineDoesNotExist) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "StateMachineDoesNotExist"
}
return *e.ErrorCodeOverride
}
func (e *StateMachineDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The maximum number of state machines has been reached. Existing state machines
// must be deleted before a new state machine can be created.
type StateMachineLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *StateMachineLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *StateMachineLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *StateMachineLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "StateMachineLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *StateMachineLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type StateMachineTypeNotSupported struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *StateMachineTypeNotSupported) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *StateMachineTypeNotSupported) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *StateMachineTypeNotSupported) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "StateMachineTypeNotSupported"
}
return *e.ErrorCodeOverride
}
func (e *StateMachineTypeNotSupported) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type TaskDoesNotExist struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TaskDoesNotExist) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TaskDoesNotExist) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TaskDoesNotExist) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TaskDoesNotExist"
}
return *e.ErrorCodeOverride
}
func (e *TaskDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type TaskTimedOut struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TaskTimedOut) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TaskTimedOut) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TaskTimedOut) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TaskTimedOut"
}
return *e.ErrorCodeOverride
}
func (e *TaskTimedOut) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You've exceeded the number of tags allowed for a resource. See the Limits Topic (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html)
// in the Step Functions Developer Guide.
type TooManyTags struct {
Message *string
ErrorCodeOverride *string
ResourceName *string
noSmithyDocumentSerde
}
func (e *TooManyTags) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyTags) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyTags) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyTags"
}
return *e.ErrorCodeOverride
}
func (e *TooManyTags) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The input does not satisfy the constraints specified by an Amazon Web Services
// service.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
Reason ValidationExceptionReason
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 }
| 726 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Contains details about an activity that failed during an execution.
type ActivityFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about an activity.
type ActivityListItem struct {
// The Amazon Resource Name (ARN) that identifies the activity.
//
// This member is required.
ActivityArn *string
// The date the activity is created.
//
// This member is required.
CreationDate *time.Time
// The name of the activity. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Contains details about an activity scheduled during an execution.
type ActivityScheduledEventDetails struct {
// The Amazon Resource Name (ARN) of the scheduled activity.
//
// This member is required.
Resource *string
// The maximum allowed duration between two heartbeats for the activity task.
HeartbeatInSeconds *int64
// The JSON data input to the activity task. Length constraints apply to the
// payload size, and are expressed as bytes in UTF-8 encoding.
Input *string
// Contains details about the input for an execution history event.
InputDetails *HistoryEventExecutionDataDetails
// The maximum allowed duration of the activity task.
TimeoutInSeconds *int64
noSmithyDocumentSerde
}
// Contains details about an activity schedule failure that occurred during an
// execution.
type ActivityScheduleFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about the start of an activity during an execution.
type ActivityStartedEventDetails struct {
// The name of the worker that the task is assigned to. These names are provided
// by the workers when calling GetActivityTask .
WorkerName *string
noSmithyDocumentSerde
}
// Contains details about an activity that successfully terminated during an
// execution.
type ActivitySucceededEventDetails struct {
// The JSON data output by the activity task. Length constraints apply to the
// payload size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about an activity timeout that occurred during an execution.
type ActivityTimedOutEventDetails struct {
// A more detailed explanation of the cause of the timeout.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// An object that describes workflow billing details.
type BillingDetails struct {
// Billed duration of your workflow, in milliseconds.
BilledDurationInMilliseconds int64
// Billed memory consumption of your workflow, in MB.
BilledMemoryUsedInMB int64
noSmithyDocumentSerde
}
// Provides details about execution input or output.
type CloudWatchEventsExecutionDataDetails struct {
// Indicates whether input or output was included in the response. Always true for
// API calls.
Included bool
noSmithyDocumentSerde
}
type CloudWatchLogsLogGroup struct {
// The ARN of the the CloudWatch log group to which you want your logs emitted to.
// The ARN must end with :*
LogGroupArn *string
noSmithyDocumentSerde
}
// Contains details about an abort of an execution.
type ExecutionAbortedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about an execution failure event.
type ExecutionFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about an execution.
type ExecutionListItem struct {
// The Amazon Resource Name (ARN) that identifies the execution.
//
// This member is required.
ExecutionArn *string
// The name of the execution. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The date the execution started.
//
// This member is required.
StartDate *time.Time
// The Amazon Resource Name (ARN) of the state machine that ran the execution.
//
// This member is required.
StateMachineArn *string
// The current status of the execution.
//
// This member is required.
Status ExecutionStatus
// The total number of items processed in a child workflow execution. This field
// is returned only if mapRunArn was specified in the ListExecutions API action.
// If stateMachineArn was specified in ListExecutions , the itemCount field isn't
// returned.
ItemCount *int32
// The Amazon Resource Name (ARN) of a Map Run. This field is returned only if
// mapRunArn was specified in the ListExecutions API action. If stateMachineArn
// was specified in ListExecutions , the mapRunArn isn't returned.
MapRunArn *string
// The Amazon Resource Name (ARN) of the state machine alias used to start an
// execution. If the state machine execution was started with an unqualified ARN or
// a version ARN, it returns null.
StateMachineAliasArn *string
// The Amazon Resource Name (ARN) of the state machine version associated with the
// execution. If the state machine execution was started with an unqualified ARN,
// it returns null. If the execution was started using a stateMachineAliasArn ,
// both the stateMachineAliasArn and stateMachineVersionArn parameters contain the
// respective values.
StateMachineVersionArn *string
// If the execution already ended, the date the execution stopped.
StopDate *time.Time
noSmithyDocumentSerde
}
// Contains details about the start of the execution.
type ExecutionStartedEventDetails struct {
// The JSON data input to the execution. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding.
Input *string
// Contains details about the input for an execution history event.
InputDetails *HistoryEventExecutionDataDetails
// The Amazon Resource Name (ARN) of the IAM role used for executing Lambda tasks.
RoleArn *string
// The Amazon Resource Name (ARN) that identifies a state machine alias used for
// starting the state machine execution.
StateMachineAliasArn *string
// The Amazon Resource Name (ARN) that identifies a state machine version used for
// starting the state machine execution.
StateMachineVersionArn *string
noSmithyDocumentSerde
}
// Contains details about the successful termination of the execution.
type ExecutionSucceededEventDetails struct {
// The JSON data output by the execution. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about the execution timeout that occurred during the execution.
type ExecutionTimedOutEventDetails struct {
// A more detailed explanation of the cause of the timeout.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about the events of an execution.
type HistoryEvent struct {
// The id of the event. Events are numbered sequentially, starting at one.
//
// This member is required.
Id int64
// The date and time the event occurred.
//
// This member is required.
Timestamp *time.Time
// The type of the event.
//
// This member is required.
Type HistoryEventType
// Contains details about an activity that failed during an execution.
ActivityFailedEventDetails *ActivityFailedEventDetails
// Contains details about an activity schedule event that failed during an
// execution.
ActivityScheduleFailedEventDetails *ActivityScheduleFailedEventDetails
// Contains details about an activity scheduled during an execution.
ActivityScheduledEventDetails *ActivityScheduledEventDetails
// Contains details about the start of an activity during an execution.
ActivityStartedEventDetails *ActivityStartedEventDetails
// Contains details about an activity that successfully terminated during an
// execution.
ActivitySucceededEventDetails *ActivitySucceededEventDetails
// Contains details about an activity timeout that occurred during an execution.
ActivityTimedOutEventDetails *ActivityTimedOutEventDetails
// Contains details about an abort of an execution.
ExecutionAbortedEventDetails *ExecutionAbortedEventDetails
// Contains details about an execution failure event.
ExecutionFailedEventDetails *ExecutionFailedEventDetails
// Contains details about the start of the execution.
ExecutionStartedEventDetails *ExecutionStartedEventDetails
// Contains details about the successful termination of the execution.
ExecutionSucceededEventDetails *ExecutionSucceededEventDetails
// Contains details about the execution timeout that occurred during the execution.
ExecutionTimedOutEventDetails *ExecutionTimedOutEventDetails
// Contains details about a Lambda function that failed during an execution.
LambdaFunctionFailedEventDetails *LambdaFunctionFailedEventDetails
// Contains details about a failed Lambda function schedule event that occurred
// during an execution.
LambdaFunctionScheduleFailedEventDetails *LambdaFunctionScheduleFailedEventDetails
// Contains details about a Lambda function scheduled during an execution.
LambdaFunctionScheduledEventDetails *LambdaFunctionScheduledEventDetails
// Contains details about a lambda function that failed to start during an
// execution.
LambdaFunctionStartFailedEventDetails *LambdaFunctionStartFailedEventDetails
// Contains details about a Lambda function that terminated successfully during an
// execution.
LambdaFunctionSucceededEventDetails *LambdaFunctionSucceededEventDetails
// Contains details about a Lambda function timeout that occurred during an
// execution.
LambdaFunctionTimedOutEventDetails *LambdaFunctionTimedOutEventDetails
// Contains details about an iteration of a Map state that was aborted.
MapIterationAbortedEventDetails *MapIterationEventDetails
// Contains details about an iteration of a Map state that failed.
MapIterationFailedEventDetails *MapIterationEventDetails
// Contains details about an iteration of a Map state that was started.
MapIterationStartedEventDetails *MapIterationEventDetails
// Contains details about an iteration of a Map state that succeeded.
MapIterationSucceededEventDetails *MapIterationEventDetails
// Contains error and cause details about a Map Run that failed.
MapRunFailedEventDetails *MapRunFailedEventDetails
// Contains details, such as mapRunArn , and the start date and time of a Map Run.
// mapRunArn is the Amazon Resource Name (ARN) of the Map Run that was started.
MapRunStartedEventDetails *MapRunStartedEventDetails
// Contains details about Map state that was started.
MapStateStartedEventDetails *MapStateStartedEventDetails
// The id of the previous event.
PreviousEventId int64
// Contains details about a state entered during an execution.
StateEnteredEventDetails *StateEnteredEventDetails
// Contains details about an exit from a state during an execution.
StateExitedEventDetails *StateExitedEventDetails
// Contains details about the failure of a task.
TaskFailedEventDetails *TaskFailedEventDetails
// Contains details about a task that was scheduled.
TaskScheduledEventDetails *TaskScheduledEventDetails
// Contains details about a task that failed to start.
TaskStartFailedEventDetails *TaskStartFailedEventDetails
// Contains details about a task that was started.
TaskStartedEventDetails *TaskStartedEventDetails
// Contains details about a task that where the submit failed.
TaskSubmitFailedEventDetails *TaskSubmitFailedEventDetails
// Contains details about a submitted task.
TaskSubmittedEventDetails *TaskSubmittedEventDetails
// Contains details about a task that succeeded.
TaskSucceededEventDetails *TaskSucceededEventDetails
// Contains details about a task that timed out.
TaskTimedOutEventDetails *TaskTimedOutEventDetails
noSmithyDocumentSerde
}
// Provides details about input or output in an execution history event.
type HistoryEventExecutionDataDetails struct {
// Indicates whether input or output was truncated in the response. Always false
// for API calls.
Truncated bool
noSmithyDocumentSerde
}
// Contains details about a Lambda function that failed during an execution.
type LambdaFunctionFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a Lambda function scheduled during an execution.
type LambdaFunctionScheduledEventDetails struct {
// The Amazon Resource Name (ARN) of the scheduled Lambda function.
//
// This member is required.
Resource *string
// The JSON data input to the Lambda function. Length constraints apply to the
// payload size, and are expressed as bytes in UTF-8 encoding.
Input *string
// Contains details about input for an execution history event.
InputDetails *HistoryEventExecutionDataDetails
// The credentials that Step Functions uses for the task.
TaskCredentials *TaskCredentials
// The maximum allowed duration of the Lambda function.
TimeoutInSeconds *int64
noSmithyDocumentSerde
}
// Contains details about a failed Lambda function schedule event that occurred
// during an execution.
type LambdaFunctionScheduleFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a lambda function that failed to start during an
// execution.
type LambdaFunctionStartFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a Lambda function that successfully terminated during an
// execution.
type LambdaFunctionSucceededEventDetails struct {
// The JSON data output by the Lambda function. Length constraints apply to the
// payload size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about a Lambda function timeout that occurred during an
// execution.
type LambdaFunctionTimedOutEventDetails struct {
// A more detailed explanation of the cause of the timeout.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
type LogDestination struct {
// An object describing a CloudWatch log group. For more information, see
// AWS::Logs::LogGroup (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html)
// in the CloudFormation User Guide.
CloudWatchLogsLogGroup *CloudWatchLogsLogGroup
noSmithyDocumentSerde
}
// The LoggingConfiguration data type is used to set CloudWatch Logs options.
type LoggingConfiguration struct {
// An array of objects that describes where your execution history events will be
// logged. Limited to size 1. Required, if your log level is not set to OFF .
Destinations []LogDestination
// Determines whether execution data is included in your log. When set to false ,
// data is excluded.
IncludeExecutionData bool
// Defines which category of execution history events are logged.
Level LogLevel
noSmithyDocumentSerde
}
// Contains details about an iteration of a Map state.
type MapIterationEventDetails struct {
// The index of the array belonging to the Map state iteration.
Index int32
// The name of the iteration’s parent Map state.
Name *string
noSmithyDocumentSerde
}
// Contains details about all of the child workflow executions started by a Map
// Run.
type MapRunExecutionCounts struct {
// The total number of child workflow executions that were started by a Map Run
// and were running, but were either stopped by the user or by Step Functions
// because the Map Run failed.
//
// This member is required.
Aborted int64
// The total number of child workflow executions that were started by a Map Run,
// but have failed.
//
// This member is required.
Failed int64
// The total number of child workflow executions that were started by a Map Run,
// but haven't started executing yet.
//
// This member is required.
Pending int64
// Returns the count of child workflow executions whose results were written by
// ResultWriter . For more information, see ResultWriter (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html)
// in the Step Functions Developer Guide.
//
// This member is required.
ResultsWritten int64
// The total number of child workflow executions that were started by a Map Run
// and are currently in-progress.
//
// This member is required.
Running int64
// The total number of child workflow executions that were started by a Map Run
// and have completed successfully.
//
// This member is required.
Succeeded int64
// The total number of child workflow executions that were started by a Map Run
// and have timed out.
//
// This member is required.
TimedOut int64
// The total number of child workflow executions that were started by a Map Run.
//
// This member is required.
Total int64
noSmithyDocumentSerde
}
// Contains details about a Map Run failure event that occurred during a state
// machine execution.
type MapRunFailedEventDetails struct {
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the Map Run failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about items that were processed in all of the child workflow
// executions that were started by a Map Run.
type MapRunItemCounts struct {
// The total number of items processed in child workflow executions that were
// either stopped by the user or by Step Functions, because the Map Run failed.
//
// This member is required.
Aborted int64
// The total number of items processed in child workflow executions that have
// failed.
//
// This member is required.
Failed int64
// The total number of items to process in child workflow executions that haven't
// started running yet.
//
// This member is required.
Pending int64
// Returns the count of items whose results were written by ResultWriter . For more
// information, see ResultWriter (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html)
// in the Step Functions Developer Guide.
//
// This member is required.
ResultsWritten int64
// The total number of items being processed in child workflow executions that are
// currently in-progress.
//
// This member is required.
Running int64
// The total number of items processed in child workflow executions that have
// completed successfully.
//
// This member is required.
Succeeded int64
// The total number of items processed in child workflow executions that have
// timed out.
//
// This member is required.
TimedOut int64
// The total number of items processed in all the child workflow executions
// started by a Map Run.
//
// This member is required.
Total int64
noSmithyDocumentSerde
}
// Contains details about a specific Map Run.
type MapRunListItem struct {
// The executionArn of the execution from which the Map Run was started.
//
// This member is required.
ExecutionArn *string
// The Amazon Resource Name (ARN) of the Map Run.
//
// This member is required.
MapRunArn *string
// The date on which the Map Run started.
//
// This member is required.
StartDate *time.Time
// The Amazon Resource Name (ARN) of the executed state machine.
//
// This member is required.
StateMachineArn *string
// The date on which the Map Run stopped.
StopDate *time.Time
noSmithyDocumentSerde
}
// Contains details about a Map Run that was started during a state machine
// execution.
type MapRunStartedEventDetails struct {
// The Amazon Resource Name (ARN) of a Map Run that was started.
MapRunArn *string
noSmithyDocumentSerde
}
// Details about a Map state that was started.
type MapStateStartedEventDetails struct {
// The size of the array for Map state iterations.
Length int32
noSmithyDocumentSerde
}
// Contains details about the routing configuration of a state machine alias. In a
// routing configuration, you define an array of objects that specify up to two
// state machine versions. You also specify the percentage of traffic to be routed
// to each version.
type RoutingConfigurationListItem struct {
// The Amazon Resource Name (ARN) that identifies one or two state machine
// versions defined in the routing configuration. If you specify the ARN of a
// second version, it must belong to the same state machine as the first version.
//
// This member is required.
StateMachineVersionArn *string
// The percentage of traffic you want to route to the second state machine
// version. The sum of the weights in the routing configuration must be equal to
// 100.
//
// This member is required.
Weight int32
noSmithyDocumentSerde
}
// Contains details about a state entered during an execution.
type StateEnteredEventDetails struct {
// The name of the state.
//
// This member is required.
Name *string
// The string that contains the JSON input data for the state. Length constraints
// apply to the payload size, and are expressed as bytes in UTF-8 encoding.
Input *string
// Contains details about the input for an execution history event.
InputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about an exit from a state during an execution.
type StateExitedEventDetails struct {
// The name of the state. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The JSON output data of the state. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about a specific state machine alias.
type StateMachineAliasListItem struct {
// The creation date of a state machine alias.
//
// This member is required.
CreationDate *time.Time
// The Amazon Resource Name (ARN) that identifies a state machine alias. The alias
// ARN is a combination of state machine ARN and the alias name separated by a
// colon (:). For example, stateMachineARN:PROD .
//
// This member is required.
StateMachineAliasArn *string
noSmithyDocumentSerde
}
// Contains details about the state machine.
type StateMachineListItem struct {
// The date the state machine is created.
//
// This member is required.
CreationDate *time.Time
// The name of the state machine. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The Amazon Resource Name (ARN) that identifies the state machine.
//
// This member is required.
StateMachineArn *string
//
//
// This member is required.
Type StateMachineType
noSmithyDocumentSerde
}
// Contains details about a specific state machine version.
type StateMachineVersionListItem struct {
// The creation date of a state machine version.
//
// This member is required.
CreationDate *time.Time
// The Amazon Resource Name (ARN) that identifies a state machine version. The
// version ARN is a combination of state machine ARN and the version number
// separated by a colon (:). For example, stateMachineARN:1 .
//
// This member is required.
StateMachineVersionArn *string
noSmithyDocumentSerde
}
// Tags are key-value pairs that can be associated with Step Functions state
// machines and activities. An array of key-value pairs. For more information, see
// Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide, and
// Controlling Access Using IAM Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html)
// . Tags may only contain Unicode letters, digits, white space, or these symbols:
// _ . : / = + - @ .
type Tag struct {
// The key of a tag.
Key *string
// The value of a tag.
Value *string
noSmithyDocumentSerde
}
// Contains details about the credentials that Step Functions uses for a task.
type TaskCredentials struct {
// The ARN of an IAM role that Step Functions assumes for the task. The role can
// allow cross-account access to resources.
RoleArn *string
noSmithyDocumentSerde
}
// Contains details about a task failure event.
type TaskFailedEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a task scheduled during an execution.
type TaskScheduledEventDetails struct {
// The JSON data passed to the resource referenced in a task state. Length
// constraints apply to the payload size, and are expressed as bytes in UTF-8
// encoding.
//
// This member is required.
Parameters *string
// The region of the scheduled task
//
// This member is required.
Region *string
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// The maximum allowed duration between two heartbeats for the task.
HeartbeatInSeconds *int64
// The credentials that Step Functions uses for the task.
TaskCredentials *TaskCredentials
// The maximum allowed duration of the task.
TimeoutInSeconds *int64
noSmithyDocumentSerde
}
// Contains details about the start of a task during an execution.
type TaskStartedEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
noSmithyDocumentSerde
}
// Contains details about a task that failed to start during an execution.
type TaskStartFailedEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a task that failed to submit during an execution.
type TaskSubmitFailedEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Contains details about a task submitted to a resource .
type TaskSubmittedEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// The response from a resource when a task has started. Length constraints apply
// to the payload size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about the successful completion of a task state.
type TaskSucceededEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// The full JSON response from a resource when a task has succeeded. This response
// becomes the output of the related task. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding.
Output *string
// Contains details about the output of an execution history event.
OutputDetails *HistoryEventExecutionDataDetails
noSmithyDocumentSerde
}
// Contains details about a resource timeout that occurred during an execution.
type TaskTimedOutEventDetails struct {
// The action of the resource called by a task state.
//
// This member is required.
Resource *string
// The service name of the resource in a task state.
//
// This member is required.
ResourceType *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
// Selects whether or not the state machine's X-Ray tracing is enabled. Default is
// false
type TracingConfiguration struct {
// When set to true , X-Ray tracing is enabled.
Enabled bool
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,097 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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 = "Shield"
const ServiceAPIVersion = "2016-06-02"
// Client provides the API client to make operations call for AWS Shield.
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, "shield", 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 shield
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 shield
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"
)
// Authorizes the Shield Response Team (SRT) to access the specified Amazon S3
// bucket containing log data such as Application Load Balancer access logs,
// CloudFront logs, or logs from third party sources. You can associate up to 10
// Amazon S3 buckets with your subscription. To use the services of the SRT and
// make an AssociateDRTLogBucket request, you must be subscribed to the Business
// Support plan (http://aws.amazon.com/premiumsupport/business-support/) or the
// Enterprise Support plan (http://aws.amazon.com/premiumsupport/enterprise-support/)
// .
func (c *Client) AssociateDRTLogBucket(ctx context.Context, params *AssociateDRTLogBucketInput, optFns ...func(*Options)) (*AssociateDRTLogBucketOutput, error) {
if params == nil {
params = &AssociateDRTLogBucketInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateDRTLogBucket", params, optFns, c.addOperationAssociateDRTLogBucketMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateDRTLogBucketOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateDRTLogBucketInput struct {
// The Amazon S3 bucket that contains the logs that you want to share.
//
// This member is required.
LogBucket *string
noSmithyDocumentSerde
}
type AssociateDRTLogBucketOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateDRTLogBucketMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateDRTLogBucket{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateDRTLogBucket{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateDRTLogBucketValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDRTLogBucket(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateDRTLogBucket(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "AssociateDRTLogBucket",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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"
)
// Authorizes the Shield Response Team (SRT) using the specified role, to access
// your Amazon Web Services account to assist with DDoS attack mitigation during
// potential attacks. This enables the SRT to inspect your WAF configuration and
// create or update WAF rules and web ACLs. You can associate only one RoleArn
// with your subscription. If you submit an AssociateDRTRole request for an
// account that already has an associated role, the new RoleArn will replace the
// existing RoleArn . Prior to making the AssociateDRTRole request, you must
// attach the AWSShieldDRTAccessPolicy managed policy to the role that you'll
// specify in the request. You can access this policy in the IAM console at
// AWSShieldDRTAccessPolicy (https://console.aws.amazon.com/iam/home?#/policies/arn:aws:iam::aws:policy/service-role/AWSShieldDRTAccessPolicy)
// . For more information see Adding and removing IAM identity permissions (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html)
// . The role must also trust the service principal drt.shield.amazonaws.com . For
// more information, see IAM JSON policy elements: Principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html)
// . The SRT will have access only to your WAF and Shield resources. By submitting
// this request, you authorize the SRT to inspect your WAF and Shield configuration
// and create and update WAF rules and web ACLs on your behalf. The SRT takes these
// actions only if explicitly authorized by you. You must have the iam:PassRole
// permission to make an AssociateDRTRole request. For more information, see
// Granting a user permissions to pass a role to an Amazon Web Services service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)
// . To use the services of the SRT and make an AssociateDRTRole request, you must
// be subscribed to the Business Support plan (http://aws.amazon.com/premiumsupport/business-support/)
// or the Enterprise Support plan (http://aws.amazon.com/premiumsupport/enterprise-support/)
// .
func (c *Client) AssociateDRTRole(ctx context.Context, params *AssociateDRTRoleInput, optFns ...func(*Options)) (*AssociateDRTRoleOutput, error) {
if params == nil {
params = &AssociateDRTRoleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateDRTRole", params, optFns, c.addOperationAssociateDRTRoleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateDRTRoleOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateDRTRoleInput struct {
// The Amazon Resource Name (ARN) of the role the SRT will use to access your
// Amazon Web Services account. Prior to making the AssociateDRTRole request, you
// must attach the AWSShieldDRTAccessPolicy (https://console.aws.amazon.com/iam/home?#/policies/arn:aws:iam::aws:policy/service-role/AWSShieldDRTAccessPolicy)
// managed policy to this role. For more information see Attaching and Detaching
// IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html)
// .
//
// This member is required.
RoleArn *string
noSmithyDocumentSerde
}
type AssociateDRTRoleOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateDRTRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateDRTRole{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateDRTRole{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateDRTRoleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDRTRole(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateDRTRole(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "AssociateDRTRole",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds health-based detection to the Shield Advanced protection for a resource.
// Shield Advanced health-based detection uses the health of your Amazon Web
// Services resource to improve responsiveness and accuracy in attack detection and
// response. You define the health check in Route 53 and then associate it with
// your Shield Advanced protection. For more information, see Shield Advanced
// Health-Based Detection (https://docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html#ddos-advanced-health-check-option)
// in the WAF Developer Guide.
func (c *Client) AssociateHealthCheck(ctx context.Context, params *AssociateHealthCheckInput, optFns ...func(*Options)) (*AssociateHealthCheckOutput, error) {
if params == nil {
params = &AssociateHealthCheckInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateHealthCheck", params, optFns, c.addOperationAssociateHealthCheckMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateHealthCheckOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateHealthCheckInput struct {
// The Amazon Resource Name (ARN) of the health check to associate with the
// protection.
//
// This member is required.
HealthCheckArn *string
// The unique identifier (ID) for the Protection object to add the health check
// association to.
//
// This member is required.
ProtectionId *string
noSmithyDocumentSerde
}
type AssociateHealthCheckOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateHealthCheck{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateHealthCheck{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateHealthCheckValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateHealthCheck(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "AssociateHealthCheck",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Initializes proactive engagement and sets the list of contacts for the Shield
// Response Team (SRT) to use. You must provide at least one phone number in the
// emergency contact list. After you have initialized proactive engagement using
// this call, to disable or enable proactive engagement, use the calls
// DisableProactiveEngagement and EnableProactiveEngagement . This call defines the
// list of email addresses and phone numbers that the SRT can use to contact you
// for escalations to the SRT and to initiate proactive customer support. The
// contacts that you provide in the request replace any contacts that were already
// defined. If you already have contacts defined and want to use them, retrieve the
// list using DescribeEmergencyContactSettings and then provide it to this call.
func (c *Client) AssociateProactiveEngagementDetails(ctx context.Context, params *AssociateProactiveEngagementDetailsInput, optFns ...func(*Options)) (*AssociateProactiveEngagementDetailsOutput, error) {
if params == nil {
params = &AssociateProactiveEngagementDetailsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateProactiveEngagementDetails", params, optFns, c.addOperationAssociateProactiveEngagementDetailsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateProactiveEngagementDetailsOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateProactiveEngagementDetailsInput struct {
// A list of email addresses and phone numbers that the Shield Response Team (SRT)
// can use to contact you for escalations to the SRT and to initiate proactive
// customer support. To enable proactive engagement, the contact list must include
// at least one phone number. The contacts that you provide here replace any
// contacts that were already defined. If you already have contacts defined and
// want to use them, retrieve the list using DescribeEmergencyContactSettings and
// then provide it here.
//
// This member is required.
EmergencyContactList []types.EmergencyContact
noSmithyDocumentSerde
}
type AssociateProactiveEngagementDetailsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateProactiveEngagementDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateProactiveEngagementDetails{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateProactiveEngagementDetails{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateProactiveEngagementDetailsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateProactiveEngagementDetails(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateProactiveEngagementDetails(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "AssociateProactiveEngagementDetails",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables Shield Advanced for a specific Amazon Web Services resource. The
// resource can be an Amazon CloudFront distribution, Amazon Route 53 hosted zone,
// Global Accelerator standard accelerator, Elastic IP Address, Application Load
// Balancer, or a Classic Load Balancer. You can protect Amazon EC2 instances and
// Network Load Balancers by association with protected Amazon EC2 Elastic IP
// addresses. You can add protection to only a single resource with each
// CreateProtection request. You can add protection to multiple resources at once
// through the Shield Advanced console at
// https://console.aws.amazon.com/wafv2/shieldv2#/ (https://console.aws.amazon.com/wafv2/shieldv2#/)
// . For more information see Getting Started with Shield Advanced (https://docs.aws.amazon.com/waf/latest/developerguide/getting-started-ddos.html)
// and Adding Shield Advanced protection to Amazon Web Services resources (https://docs.aws.amazon.com/waf/latest/developerguide/configure-new-protection.html)
// .
func (c *Client) CreateProtection(ctx context.Context, params *CreateProtectionInput, optFns ...func(*Options)) (*CreateProtectionOutput, error) {
if params == nil {
params = &CreateProtectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProtection", params, optFns, c.addOperationCreateProtectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProtectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProtectionInput struct {
// Friendly name for the Protection you are creating.
//
// This member is required.
Name *string
// The ARN (Amazon Resource Name) of the resource to be protected. The ARN should
// be in one of the following formats:
// - For an Application Load Balancer:
// arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
//
// - For an Elastic Load Balancer (Classic Load Balancer):
// arn:aws:elasticloadbalancing:region:account-id:loadbalancer/load-balancer-name
// - For an Amazon CloudFront distribution:
// arn:aws:cloudfront::account-id:distribution/distribution-id
// - For an Global Accelerator standard accelerator:
// arn:aws:globalaccelerator::account-id:accelerator/accelerator-id
// - For Amazon Route 53: arn:aws:route53:::hostedzone/hosted-zone-id
// - For an Elastic IP address:
// arn:aws:ec2:region:account-id:eip-allocation/allocation-id
//
// This member is required.
ResourceArn *string
// One or more tag key-value pairs for the Protection object that is created.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateProtectionOutput struct {
// The unique identifier (ID) for the Protection object that is created.
ProtectionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProtection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProtection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateProtectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProtection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateProtection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "CreateProtection",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a grouping of protected resources so they can be handled as a
// collective. This resource grouping improves the accuracy of detection and
// reduces false positives.
func (c *Client) CreateProtectionGroup(ctx context.Context, params *CreateProtectionGroupInput, optFns ...func(*Options)) (*CreateProtectionGroupOutput, error) {
if params == nil {
params = &CreateProtectionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProtectionGroup", params, optFns, c.addOperationCreateProtectionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProtectionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProtectionGroupInput struct {
// Defines how Shield combines resource data for the group in order to detect,
// mitigate, and report events.
// - Sum - Use the total traffic across the group. This is a good choice for
// most cases. Examples include Elastic IP addresses for EC2 instances that scale
// manually or automatically.
// - Mean - Use the average of the traffic across the group. This is a good
// choice for resources that share traffic uniformly. Examples include accelerators
// and load balancers.
// - Max - Use the highest traffic from each resource. This is useful for
// resources that don't share traffic and for resources that share that traffic in
// a non-uniform way. Examples include Amazon CloudFront and origin resources for
// CloudFront distributions.
//
// This member is required.
Aggregation types.ProtectionGroupAggregation
// The criteria to use to choose the protected resources for inclusion in the
// group. You can include all resources that have protections, provide a list of
// resource Amazon Resource Names (ARNs), or include all resources of a specified
// resource type.
//
// This member is required.
Pattern types.ProtectionGroupPattern
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
// The Amazon Resource Names (ARNs) of the resources to include in the protection
// group. You must set this when you set Pattern to ARBITRARY and you must not set
// it for any other Pattern setting.
Members []string
// The resource type to include in the protection group. All protected resources
// of this type are included in the protection group. Newly protected resources of
// this type are automatically added to the group. You must set this when you set
// Pattern to BY_RESOURCE_TYPE and you must not set it for any other Pattern
// setting.
ResourceType types.ProtectedResourceType
// One or more tag key-value pairs for the protection group.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateProtectionGroupOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProtectionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProtectionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProtectionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateProtectionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProtectionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateProtectionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "CreateProtectionGroup",
}
}
| 164 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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"
)
// Activates Shield Advanced for an account. For accounts that are members of an
// Organizations organization, Shield Advanced subscriptions are billed against the
// organization's payer account, regardless of whether the payer account itself is
// subscribed. When you initially create a subscription, your subscription is set
// to be automatically renewed at the end of the existing subscription period. You
// can change this by submitting an UpdateSubscription request.
func (c *Client) CreateSubscription(ctx context.Context, params *CreateSubscriptionInput, optFns ...func(*Options)) (*CreateSubscriptionOutput, error) {
if params == nil {
params = &CreateSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSubscription", params, optFns, c.addOperationCreateSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSubscriptionInput struct {
noSmithyDocumentSerde
}
type CreateSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opCreateSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "CreateSubscription",
}
}
| 116 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Shield Advanced Protection .
func (c *Client) DeleteProtection(ctx context.Context, params *DeleteProtectionInput, optFns ...func(*Options)) (*DeleteProtectionOutput, error) {
if params == nil {
params = &DeleteProtectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProtection", params, optFns, c.addOperationDeleteProtectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProtectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProtectionInput struct {
// The unique identifier (ID) for the Protection object to be deleted.
//
// This member is required.
ProtectionId *string
noSmithyDocumentSerde
}
type DeleteProtectionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProtection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProtection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProtectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProtection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteProtection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DeleteProtection",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the specified protection group.
func (c *Client) DeleteProtectionGroup(ctx context.Context, params *DeleteProtectionGroupInput, optFns ...func(*Options)) (*DeleteProtectionGroupOutput, error) {
if params == nil {
params = &DeleteProtectionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProtectionGroup", params, optFns, c.addOperationDeleteProtectionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProtectionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProtectionGroupInput struct {
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
noSmithyDocumentSerde
}
type DeleteProtectionGroupOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProtectionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProtectionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProtectionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProtectionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProtectionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteProtectionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DeleteProtectionGroup",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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 Shield Advanced from an account. Shield Advanced requires a 1-year
// subscription commitment. You cannot delete a subscription prior to the
// completion of that commitment.
//
// Deprecated: This operation has been deprecated.
func (c *Client) DeleteSubscription(ctx context.Context, params *DeleteSubscriptionInput, optFns ...func(*Options)) (*DeleteSubscriptionOutput, error) {
if params == nil {
params = &DeleteSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSubscription", params, optFns, c.addOperationDeleteSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSubscriptionInput struct {
noSmithyDocumentSerde
}
type DeleteSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDeleteSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DeleteSubscription",
}
}
| 115 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the details of a DDoS attack.
func (c *Client) DescribeAttack(ctx context.Context, params *DescribeAttackInput, optFns ...func(*Options)) (*DescribeAttackOutput, error) {
if params == nil {
params = &DescribeAttackInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAttack", params, optFns, c.addOperationDescribeAttackMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAttackOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAttackInput struct {
// The unique identifier (ID) for the attack.
//
// This member is required.
AttackId *string
noSmithyDocumentSerde
}
type DescribeAttackOutput struct {
// The attack that you requested.
Attack *types.AttackDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAttackMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAttack{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAttack{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAttackValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAttack(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeAttack(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeAttack",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the number and type of attacks Shield has detected
// in the last year for all resources that belong to your account, regardless of
// whether you've defined Shield protections for them. This operation is available
// to Shield customers as well as to Shield Advanced customers. The operation
// returns data for the time range of midnight UTC, one year ago, to midnight UTC,
// today. For example, if the current time is 2020-10-26 15:39:32 PDT , equal to
// 2020-10-26 22:39:32 UTC , then the time range for the attack data returned is
// from 2019-10-26 00:00:00 UTC to 2020-10-26 00:00:00 UTC . The time range
// indicates the period covered by the attack statistics data items.
func (c *Client) DescribeAttackStatistics(ctx context.Context, params *DescribeAttackStatisticsInput, optFns ...func(*Options)) (*DescribeAttackStatisticsOutput, error) {
if params == nil {
params = &DescribeAttackStatisticsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAttackStatistics", params, optFns, c.addOperationDescribeAttackStatisticsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAttackStatisticsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAttackStatisticsInput struct {
noSmithyDocumentSerde
}
type DescribeAttackStatisticsOutput struct {
// The data that describes the attacks detected during the time period.
//
// This member is required.
DataItems []types.AttackStatisticsDataItem
// The time range of the attack.
//
// This member is required.
TimeRange *types.TimeRange
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAttackStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAttackStatistics{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAttackStatistics{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeAttackStatistics(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeAttackStatistics(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeAttackStatistics",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the current role and list of Amazon S3 log buckets used by the Shield
// Response Team (SRT) to access your Amazon Web Services account while assisting
// with attack mitigation.
func (c *Client) DescribeDRTAccess(ctx context.Context, params *DescribeDRTAccessInput, optFns ...func(*Options)) (*DescribeDRTAccessOutput, error) {
if params == nil {
params = &DescribeDRTAccessInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDRTAccess", params, optFns, c.addOperationDescribeDRTAccessMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDRTAccessOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDRTAccessInput struct {
noSmithyDocumentSerde
}
type DescribeDRTAccessOutput struct {
// The list of Amazon S3 buckets accessed by the SRT.
LogBucketList []string
// The Amazon Resource Name (ARN) of the role the SRT used to access your Amazon
// Web Services account.
RoleArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDRTAccessMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDRTAccess{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDRTAccess{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeDRTAccess(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeDRTAccess(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeDRTAccess",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// A list of email addresses and phone numbers that the Shield Response Team (SRT)
// can use to contact you if you have proactive engagement enabled, for escalations
// to the SRT and to initiate proactive customer support.
func (c *Client) DescribeEmergencyContactSettings(ctx context.Context, params *DescribeEmergencyContactSettingsInput, optFns ...func(*Options)) (*DescribeEmergencyContactSettingsOutput, error) {
if params == nil {
params = &DescribeEmergencyContactSettingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeEmergencyContactSettings", params, optFns, c.addOperationDescribeEmergencyContactSettingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeEmergencyContactSettingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeEmergencyContactSettingsInput struct {
noSmithyDocumentSerde
}
type DescribeEmergencyContactSettingsOutput struct {
// A list of email addresses and phone numbers that the Shield Response Team (SRT)
// can use to contact you if you have proactive engagement enabled, for escalations
// to the SRT and to initiate proactive customer support.
EmergencyContactList []types.EmergencyContact
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeEmergencyContactSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEmergencyContactSettings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEmergencyContactSettings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeEmergencyContactSettings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeEmergencyContactSettings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeEmergencyContactSettings",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the details of a Protection object.
func (c *Client) DescribeProtection(ctx context.Context, params *DescribeProtectionInput, optFns ...func(*Options)) (*DescribeProtectionOutput, error) {
if params == nil {
params = &DescribeProtectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeProtection", params, optFns, c.addOperationDescribeProtectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeProtectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeProtectionInput struct {
// The unique identifier (ID) for the Protection object to describe. You must
// provide either the ResourceArn of the protected resource or the ProtectionID of
// the protection, but not both.
ProtectionId *string
// The ARN (Amazon Resource Name) of the protected Amazon Web Services resource.
// You must provide either the ResourceArn of the protected resource or the
// ProtectionID of the protection, but not both.
ResourceArn *string
noSmithyDocumentSerde
}
type DescribeProtectionOutput struct {
// The Protection that you requested.
Protection *types.Protection
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeProtection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeProtection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeProtection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeProtection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeProtection",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the specification for the specified protection group.
func (c *Client) DescribeProtectionGroup(ctx context.Context, params *DescribeProtectionGroupInput, optFns ...func(*Options)) (*DescribeProtectionGroupOutput, error) {
if params == nil {
params = &DescribeProtectionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeProtectionGroup", params, optFns, c.addOperationDescribeProtectionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeProtectionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeProtectionGroupInput struct {
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
noSmithyDocumentSerde
}
type DescribeProtectionGroupOutput struct {
// A grouping of protected resources that you and Shield Advanced can monitor as a
// collective. This resource grouping improves the accuracy of detection and
// reduces false positives.
//
// This member is required.
ProtectionGroup *types.ProtectionGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeProtectionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeProtectionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeProtectionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeProtectionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProtectionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeProtectionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeProtectionGroup",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides details about the Shield Advanced subscription for an account.
func (c *Client) DescribeSubscription(ctx context.Context, params *DescribeSubscriptionInput, optFns ...func(*Options)) (*DescribeSubscriptionOutput, error) {
if params == nil {
params = &DescribeSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSubscription", params, optFns, c.addOperationDescribeSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSubscriptionInput struct {
noSmithyDocumentSerde
}
type DescribeSubscriptionOutput struct {
// The Shield Advanced subscription details for an account.
Subscription *types.Subscription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DescribeSubscription",
}
}
| 116 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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"
)
// Disable the Shield Advanced automatic application layer DDoS mitigation feature
// for the protected resource. This stops Shield Advanced from creating, verifying,
// and applying WAF rules for attacks that it detects for the resource.
func (c *Client) DisableApplicationLayerAutomaticResponse(ctx context.Context, params *DisableApplicationLayerAutomaticResponseInput, optFns ...func(*Options)) (*DisableApplicationLayerAutomaticResponseOutput, error) {
if params == nil {
params = &DisableApplicationLayerAutomaticResponseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisableApplicationLayerAutomaticResponse", params, optFns, c.addOperationDisableApplicationLayerAutomaticResponseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableApplicationLayerAutomaticResponseOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisableApplicationLayerAutomaticResponseInput struct {
// The ARN (Amazon Resource Name) of the protected resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type DisableApplicationLayerAutomaticResponseOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableApplicationLayerAutomaticResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisableApplicationLayerAutomaticResponseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableApplicationLayerAutomaticResponse(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisableApplicationLayerAutomaticResponse(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DisableApplicationLayerAutomaticResponse",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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 authorization from the Shield Response Team (SRT) to notify contacts
// about escalations to the SRT and to initiate proactive customer support.
func (c *Client) DisableProactiveEngagement(ctx context.Context, params *DisableProactiveEngagementInput, optFns ...func(*Options)) (*DisableProactiveEngagementOutput, error) {
if params == nil {
params = &DisableProactiveEngagementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisableProactiveEngagement", params, optFns, c.addOperationDisableProactiveEngagementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableProactiveEngagementOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisableProactiveEngagementInput struct {
noSmithyDocumentSerde
}
type DisableProactiveEngagementOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableProactiveEngagementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableProactiveEngagement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableProactiveEngagement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDisableProactiveEngagement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisableProactiveEngagement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DisableProactiveEngagement",
}
}
| 112 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the Shield Response Team's (SRT) access to the specified Amazon S3
// bucket containing the logs that you shared previously.
func (c *Client) DisassociateDRTLogBucket(ctx context.Context, params *DisassociateDRTLogBucketInput, optFns ...func(*Options)) (*DisassociateDRTLogBucketOutput, error) {
if params == nil {
params = &DisassociateDRTLogBucketInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateDRTLogBucket", params, optFns, c.addOperationDisassociateDRTLogBucketMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateDRTLogBucketOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateDRTLogBucketInput struct {
// The Amazon S3 bucket that contains the logs that you want to share.
//
// This member is required.
LogBucket *string
noSmithyDocumentSerde
}
type DisassociateDRTLogBucketOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateDRTLogBucketMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateDRTLogBucket{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateDRTLogBucket{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisassociateDRTLogBucketValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateDRTLogBucket(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisassociateDRTLogBucket(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DisassociateDRTLogBucket",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the Shield Response Team's (SRT) access to your Amazon Web Services
// account.
func (c *Client) DisassociateDRTRole(ctx context.Context, params *DisassociateDRTRoleInput, optFns ...func(*Options)) (*DisassociateDRTRoleOutput, error) {
if params == nil {
params = &DisassociateDRTRoleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateDRTRole", params, optFns, c.addOperationDisassociateDRTRoleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateDRTRoleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateDRTRoleInput struct {
noSmithyDocumentSerde
}
type DisassociateDRTRoleOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateDRTRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateDRTRole{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateDRTRole{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDisassociateDRTRole(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisassociateDRTRole(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DisassociateDRTRole",
}
}
| 112 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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 health-based detection from the Shield Advanced protection for a
// resource. Shield Advanced health-based detection uses the health of your Amazon
// Web Services resource to improve responsiveness and accuracy in attack detection
// and response. You define the health check in Route 53 and then associate or
// disassociate it with your Shield Advanced protection. For more information, see
// Shield Advanced Health-Based Detection (https://docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html#ddos-advanced-health-check-option)
// in the WAF Developer Guide.
func (c *Client) DisassociateHealthCheck(ctx context.Context, params *DisassociateHealthCheckInput, optFns ...func(*Options)) (*DisassociateHealthCheckOutput, error) {
if params == nil {
params = &DisassociateHealthCheckInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateHealthCheck", params, optFns, c.addOperationDisassociateHealthCheckMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateHealthCheckOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateHealthCheckInput struct {
// The Amazon Resource Name (ARN) of the health check that is associated with the
// protection.
//
// This member is required.
HealthCheckArn *string
// The unique identifier (ID) for the Protection object to remove the health check
// association from.
//
// This member is required.
ProtectionId *string
noSmithyDocumentSerde
}
type DisassociateHealthCheckOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateHealthCheck{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateHealthCheck{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisassociateHealthCheckValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateHealthCheck(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisassociateHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "DisassociateHealthCheck",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enable the Shield Advanced automatic application layer DDoS mitigation for the
// protected resource. This feature is available for Amazon CloudFront
// distributions and Application Load Balancers only. This causes Shield Advanced
// to create, verify, and apply WAF rules for DDoS attacks that it detects for the
// resource. Shield Advanced applies the rules in a Shield rule group inside the
// web ACL that you've associated with the resource. For information about how
// automatic mitigation works and the requirements for using it, see Shield
// Advanced automatic application layer DDoS mitigation (https://docs.aws.amazon.com/waf/latest/developerguide/ddos-advanced-automatic-app-layer-response.html)
// . Don't use this action to make changes to automatic mitigation settings when
// it's already enabled for a resource. Instead, use
// UpdateApplicationLayerAutomaticResponse . To use this feature, you must
// associate a web ACL with the protected resource. The web ACL must be created
// using the latest version of WAF (v2). You can associate the web ACL through the
// Shield Advanced console at https://console.aws.amazon.com/wafv2/shieldv2#/ (https://console.aws.amazon.com/wafv2/shieldv2#/)
// . For more information, see Getting Started with Shield Advanced (https://docs.aws.amazon.com/waf/latest/developerguide/getting-started-ddos.html)
// . You can also associate the web ACL to the resource through the WAF console or
// the WAF API, but you must manage Shield Advanced automatic mitigation through
// Shield Advanced. For information about WAF, see WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
func (c *Client) EnableApplicationLayerAutomaticResponse(ctx context.Context, params *EnableApplicationLayerAutomaticResponseInput, optFns ...func(*Options)) (*EnableApplicationLayerAutomaticResponseOutput, error) {
if params == nil {
params = &EnableApplicationLayerAutomaticResponseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "EnableApplicationLayerAutomaticResponse", params, optFns, c.addOperationEnableApplicationLayerAutomaticResponseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*EnableApplicationLayerAutomaticResponseOutput)
out.ResultMetadata = metadata
return out, nil
}
type EnableApplicationLayerAutomaticResponseInput struct {
// Specifies the action setting that Shield Advanced should use in the WAF rules
// that it creates on behalf of the protected resource in response to DDoS attacks.
// You specify this as part of the configuration for the automatic application
// layer DDoS mitigation feature, when you enable or update automatic mitigation.
// Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group,
// inside the web ACL that you have associated with the resource.
//
// This member is required.
Action *types.ResponseAction
// The ARN (Amazon Resource Name) of the protected resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type EnableApplicationLayerAutomaticResponseOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationEnableApplicationLayerAutomaticResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpEnableApplicationLayerAutomaticResponseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableApplicationLayerAutomaticResponse(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opEnableApplicationLayerAutomaticResponse(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "EnableApplicationLayerAutomaticResponse",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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"
)
// Authorizes the Shield Response Team (SRT) to use email and phone to notify
// contacts about escalations to the SRT and to initiate proactive customer
// support.
func (c *Client) EnableProactiveEngagement(ctx context.Context, params *EnableProactiveEngagementInput, optFns ...func(*Options)) (*EnableProactiveEngagementOutput, error) {
if params == nil {
params = &EnableProactiveEngagementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "EnableProactiveEngagement", params, optFns, c.addOperationEnableProactiveEngagementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*EnableProactiveEngagementOutput)
out.ResultMetadata = metadata
return out, nil
}
type EnableProactiveEngagementInput struct {
noSmithyDocumentSerde
}
type EnableProactiveEngagementOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationEnableProactiveEngagementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableProactiveEngagement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableProactiveEngagement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opEnableProactiveEngagement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opEnableProactiveEngagement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "EnableProactiveEngagement",
}
}
| 113 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the SubscriptionState , either Active or Inactive .
func (c *Client) GetSubscriptionState(ctx context.Context, params *GetSubscriptionStateInput, optFns ...func(*Options)) (*GetSubscriptionStateOutput, error) {
if params == nil {
params = &GetSubscriptionStateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSubscriptionState", params, optFns, c.addOperationGetSubscriptionStateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSubscriptionStateOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSubscriptionStateInput struct {
noSmithyDocumentSerde
}
type GetSubscriptionStateOutput struct {
// The status of the subscription.
//
// This member is required.
SubscriptionState types.SubscriptionState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSubscriptionStateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSubscriptionState{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSubscriptionState{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetSubscriptionState(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetSubscriptionState(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "GetSubscriptionState",
}
}
| 118 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns all ongoing DDoS attacks or all DDoS attacks during a specified time
// period.
func (c *Client) ListAttacks(ctx context.Context, params *ListAttacksInput, optFns ...func(*Options)) (*ListAttacksOutput, error) {
if params == nil {
params = &ListAttacksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAttacks", params, optFns, c.addOperationListAttacksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAttacksOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAttacksInput struct {
// The end of the time period for the attacks. This is a timestamp type. The
// request syntax listing for this call indicates a number type, but you can
// provide the time in any valid timestamp format (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp)
// setting.
EndTime *types.TimeRange
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
MaxResults *int32
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value. On your first call to a list operation, leave this setting
// empty.
NextToken *string
// The ARNs (Amazon Resource Names) of the resources that were attacked. If you
// leave this blank, all applicable resources for this account will be included.
ResourceArns []string
// The start of the time period for the attacks. This is a timestamp type. The
// request syntax listing for this call indicates a number type, but you can
// provide the time in any valid timestamp format (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp)
// setting.
StartTime *types.TimeRange
noSmithyDocumentSerde
}
type ListAttacksOutput struct {
// The attack information for the specified time range.
AttackSummaries []types.AttackSummary
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAttacksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAttacks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAttacks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAttacks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListAttacksAPIClient is a client that implements the ListAttacks operation.
type ListAttacksAPIClient interface {
ListAttacks(context.Context, *ListAttacksInput, ...func(*Options)) (*ListAttacksOutput, error)
}
var _ ListAttacksAPIClient = (*Client)(nil)
// ListAttacksPaginatorOptions is the paginator options for ListAttacks
type ListAttacksPaginatorOptions struct {
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAttacksPaginator is a paginator for ListAttacks
type ListAttacksPaginator struct {
options ListAttacksPaginatorOptions
client ListAttacksAPIClient
params *ListAttacksInput
nextToken *string
firstPage bool
}
// NewListAttacksPaginator returns a new ListAttacksPaginator
func NewListAttacksPaginator(client ListAttacksAPIClient, params *ListAttacksInput, optFns ...func(*ListAttacksPaginatorOptions)) *ListAttacksPaginator {
if params == nil {
params = &ListAttacksInput{}
}
options := ListAttacksPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAttacksPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAttacksPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAttacks page.
func (p *ListAttacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttacksOutput, 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.ListAttacks(ctx, ¶ms, 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_opListAttacks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "ListAttacks",
}
}
| 260 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves ProtectionGroup objects for the account. You can retrieve all
// protection groups or you can provide filtering criteria and retrieve just the
// subset of protection groups that match the criteria.
func (c *Client) ListProtectionGroups(ctx context.Context, params *ListProtectionGroupsInput, optFns ...func(*Options)) (*ListProtectionGroupsOutput, error) {
if params == nil {
params = &ListProtectionGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProtectionGroups", params, optFns, c.addOperationListProtectionGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProtectionGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProtectionGroupsInput struct {
// Narrows the set of protection groups that the call retrieves. You can retrieve
// a single protection group by its name and you can retrieve all protection groups
// that are configured with specific pattern or aggregation settings. You can
// provide up to one criteria per filter type. Shield Advanced returns the
// protection groups that exactly match all of the search criteria that you
// provide.
InclusionFilters *types.InclusionProtectionGroupFilters
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
MaxResults *int32
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value. On your first call to a list operation, leave this setting
// empty.
NextToken *string
noSmithyDocumentSerde
}
type ListProtectionGroupsOutput struct {
//
//
// This member is required.
ProtectionGroups []types.ProtectionGroup
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProtectionGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListProtectionGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListProtectionGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListProtectionGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListProtectionGroupsAPIClient is a client that implements the
// ListProtectionGroups operation.
type ListProtectionGroupsAPIClient interface {
ListProtectionGroups(context.Context, *ListProtectionGroupsInput, ...func(*Options)) (*ListProtectionGroupsOutput, error)
}
var _ ListProtectionGroupsAPIClient = (*Client)(nil)
// ListProtectionGroupsPaginatorOptions is the paginator options for
// ListProtectionGroups
type ListProtectionGroupsPaginatorOptions struct {
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListProtectionGroupsPaginator is a paginator for ListProtectionGroups
type ListProtectionGroupsPaginator struct {
options ListProtectionGroupsPaginatorOptions
client ListProtectionGroupsAPIClient
params *ListProtectionGroupsInput
nextToken *string
firstPage bool
}
// NewListProtectionGroupsPaginator returns a new ListProtectionGroupsPaginator
func NewListProtectionGroupsPaginator(client ListProtectionGroupsAPIClient, params *ListProtectionGroupsInput, optFns ...func(*ListProtectionGroupsPaginatorOptions)) *ListProtectionGroupsPaginator {
if params == nil {
params = &ListProtectionGroupsInput{}
}
options := ListProtectionGroupsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListProtectionGroupsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListProtectionGroupsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListProtectionGroups page.
func (p *ListProtectionGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectionGroupsOutput, 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.ListProtectionGroups(ctx, ¶ms, 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_opListProtectionGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "ListProtectionGroups",
}
}
| 257 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves Protection objects for the account. You can retrieve all protections
// or you can provide filtering criteria and retrieve just the subset of
// protections that match the criteria.
func (c *Client) ListProtections(ctx context.Context, params *ListProtectionsInput, optFns ...func(*Options)) (*ListProtectionsOutput, error) {
if params == nil {
params = &ListProtectionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProtections", params, optFns, c.addOperationListProtectionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProtectionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProtectionsInput struct {
// Narrows the set of protections that the call retrieves. You can retrieve a
// single protection by providing its name or the ARN (Amazon Resource Name) of its
// protected resource. You can also retrieve all protections for a specific
// resource type. You can provide up to one criteria per filter type. Shield
// Advanced returns protections that exactly match all of the filter criteria that
// you provide.
InclusionFilters *types.InclusionProtectionFilters
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
MaxResults *int32
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value. On your first call to a list operation, leave this setting
// empty.
NextToken *string
noSmithyDocumentSerde
}
type ListProtectionsOutput struct {
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value.
NextToken *string
// The array of enabled Protection objects.
Protections []types.Protection
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProtectionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListProtections{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListProtections{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListProtections(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListProtectionsAPIClient is a client that implements the ListProtections
// operation.
type ListProtectionsAPIClient interface {
ListProtections(context.Context, *ListProtectionsInput, ...func(*Options)) (*ListProtectionsOutput, error)
}
var _ ListProtectionsAPIClient = (*Client)(nil)
// ListProtectionsPaginatorOptions is the paginator options for ListProtections
type ListProtectionsPaginatorOptions struct {
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListProtectionsPaginator is a paginator for ListProtections
type ListProtectionsPaginator struct {
options ListProtectionsPaginatorOptions
client ListProtectionsAPIClient
params *ListProtectionsInput
nextToken *string
firstPage bool
}
// NewListProtectionsPaginator returns a new ListProtectionsPaginator
func NewListProtectionsPaginator(client ListProtectionsAPIClient, params *ListProtectionsInput, optFns ...func(*ListProtectionsPaginatorOptions)) *ListProtectionsPaginator {
if params == nil {
params = &ListProtectionsInput{}
}
options := ListProtectionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListProtectionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListProtectionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListProtections page.
func (p *ListProtectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectionsOutput, 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.ListProtections(ctx, ¶ms, 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_opListProtections(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "ListProtections",
}
}
| 254 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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"
)
// Retrieves the resources that are included in the protection group.
func (c *Client) ListResourcesInProtectionGroup(ctx context.Context, params *ListResourcesInProtectionGroupInput, optFns ...func(*Options)) (*ListResourcesInProtectionGroupOutput, error) {
if params == nil {
params = &ListResourcesInProtectionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListResourcesInProtectionGroup", params, optFns, c.addOperationListResourcesInProtectionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListResourcesInProtectionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListResourcesInProtectionGroupInput struct {
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
MaxResults *int32
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value. On your first call to a list operation, leave this setting
// empty.
NextToken *string
noSmithyDocumentSerde
}
type ListResourcesInProtectionGroupOutput struct {
// The Amazon Resource Names (ARNs) of the resources that are included in the
// protection group.
//
// This member is required.
ResourceArns []string
// When you request a list of objects from Shield Advanced, if the response does
// not include all of the remaining available objects, Shield Advanced includes a
// NextToken value in the response. You can retrieve the next batch of objects by
// requesting the list again and providing the token that was returned by the prior
// call in your request. You can indicate the maximum number of objects that you
// want Shield Advanced to return for a single call with the MaxResults setting.
// Shield Advanced will not return more than MaxResults objects, but may return
// fewer, even if more objects are still available. Whenever more objects remain
// that Shield Advanced has not yet returned to you, the response will include a
// NextToken value.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListResourcesInProtectionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourcesInProtectionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourcesInProtectionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListResourcesInProtectionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourcesInProtectionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListResourcesInProtectionGroupAPIClient is a client that implements the
// ListResourcesInProtectionGroup operation.
type ListResourcesInProtectionGroupAPIClient interface {
ListResourcesInProtectionGroup(context.Context, *ListResourcesInProtectionGroupInput, ...func(*Options)) (*ListResourcesInProtectionGroupOutput, error)
}
var _ ListResourcesInProtectionGroupAPIClient = (*Client)(nil)
// ListResourcesInProtectionGroupPaginatorOptions is the paginator options for
// ListResourcesInProtectionGroup
type ListResourcesInProtectionGroupPaginatorOptions struct {
// The greatest number of objects that you want Shield Advanced to return to the
// list request. Shield Advanced might return fewer objects than you indicate in
// this setting, even if more objects are available. If there are more objects
// remaining, Shield Advanced will always also return a NextToken value in the
// response. The default setting is 20.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListResourcesInProtectionGroupPaginator is a paginator for
// ListResourcesInProtectionGroup
type ListResourcesInProtectionGroupPaginator struct {
options ListResourcesInProtectionGroupPaginatorOptions
client ListResourcesInProtectionGroupAPIClient
params *ListResourcesInProtectionGroupInput
nextToken *string
firstPage bool
}
// NewListResourcesInProtectionGroupPaginator returns a new
// ListResourcesInProtectionGroupPaginator
func NewListResourcesInProtectionGroupPaginator(client ListResourcesInProtectionGroupAPIClient, params *ListResourcesInProtectionGroupInput, optFns ...func(*ListResourcesInProtectionGroupPaginatorOptions)) *ListResourcesInProtectionGroupPaginator {
if params == nil {
params = &ListResourcesInProtectionGroupInput{}
}
options := ListResourcesInProtectionGroupPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListResourcesInProtectionGroupPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListResourcesInProtectionGroupPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListResourcesInProtectionGroup page.
func (p *ListResourcesInProtectionGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesInProtectionGroupOutput, 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.ListResourcesInProtectionGroup(ctx, ¶ms, 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_opListResourcesInProtectionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "ListResourcesInProtectionGroup",
}
}
| 259 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about Amazon Web Services tags for a specified Amazon Resource
// Name (ARN) in Shield.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource to get tags for.
//
// This member is required.
ResourceARN *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// A list of tag key and value pairs associated with the specified resource.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or updates tags for a resource in Shield.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource that you want to add or update
// tags for.
//
// This member is required.
ResourceARN *string
// The tags that you want to modify or add to the resource.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "TagResource",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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 tags from a resource in Shield.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource that you want to remove tags
// from.
//
// This member is required.
ResourceARN *string
// The tag key for each tag that you want 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(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "UntagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing Shield Advanced automatic application layer DDoS mitigation
// configuration for the specified resource.
func (c *Client) UpdateApplicationLayerAutomaticResponse(ctx context.Context, params *UpdateApplicationLayerAutomaticResponseInput, optFns ...func(*Options)) (*UpdateApplicationLayerAutomaticResponseOutput, error) {
if params == nil {
params = &UpdateApplicationLayerAutomaticResponseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateApplicationLayerAutomaticResponse", params, optFns, c.addOperationUpdateApplicationLayerAutomaticResponseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateApplicationLayerAutomaticResponseOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateApplicationLayerAutomaticResponseInput struct {
// Specifies the action setting that Shield Advanced should use in the WAF rules
// that it creates on behalf of the protected resource in response to DDoS attacks.
// You specify this as part of the configuration for the automatic application
// layer DDoS mitigation feature, when you enable or update automatic mitigation.
// Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group,
// inside the web ACL that you have associated with the resource.
//
// This member is required.
Action *types.ResponseAction
// The ARN (Amazon Resource Name) of the resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type UpdateApplicationLayerAutomaticResponseOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateApplicationLayerAutomaticResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateApplicationLayerAutomaticResponse{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateApplicationLayerAutomaticResponseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplicationLayerAutomaticResponse(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateApplicationLayerAutomaticResponse(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "UpdateApplicationLayerAutomaticResponse",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the details of the list of email addresses and phone numbers that the
// Shield Response Team (SRT) can use to contact you if you have proactive
// engagement enabled, for escalations to the SRT and to initiate proactive
// customer support.
func (c *Client) UpdateEmergencyContactSettings(ctx context.Context, params *UpdateEmergencyContactSettingsInput, optFns ...func(*Options)) (*UpdateEmergencyContactSettingsOutput, error) {
if params == nil {
params = &UpdateEmergencyContactSettingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateEmergencyContactSettings", params, optFns, c.addOperationUpdateEmergencyContactSettingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateEmergencyContactSettingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateEmergencyContactSettingsInput struct {
// A list of email addresses and phone numbers that the Shield Response Team (SRT)
// can use to contact you if you have proactive engagement enabled, for escalations
// to the SRT and to initiate proactive customer support. If you have proactive
// engagement enabled, the contact list must include at least one phone number.
EmergencyContactList []types.EmergencyContact
noSmithyDocumentSerde
}
type UpdateEmergencyContactSettingsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateEmergencyContactSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateEmergencyContactSettings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateEmergencyContactSettings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateEmergencyContactSettingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEmergencyContactSettings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateEmergencyContactSettings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "UpdateEmergencyContactSettings",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing protection group. A protection group is a grouping of
// protected resources so they can be handled as a collective. This resource
// grouping improves the accuracy of detection and reduces false positives.
func (c *Client) UpdateProtectionGroup(ctx context.Context, params *UpdateProtectionGroupInput, optFns ...func(*Options)) (*UpdateProtectionGroupOutput, error) {
if params == nil {
params = &UpdateProtectionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateProtectionGroup", params, optFns, c.addOperationUpdateProtectionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateProtectionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateProtectionGroupInput struct {
// Defines how Shield combines resource data for the group in order to detect,
// mitigate, and report events.
// - Sum - Use the total traffic across the group. This is a good choice for
// most cases. Examples include Elastic IP addresses for EC2 instances that scale
// manually or automatically.
// - Mean - Use the average of the traffic across the group. This is a good
// choice for resources that share traffic uniformly. Examples include accelerators
// and load balancers.
// - Max - Use the highest traffic from each resource. This is useful for
// resources that don't share traffic and for resources that share that traffic in
// a non-uniform way. Examples include Amazon CloudFront distributions and origin
// resources for CloudFront distributions.
//
// This member is required.
Aggregation types.ProtectionGroupAggregation
// The criteria to use to choose the protected resources for inclusion in the
// group. You can include all resources that have protections, provide a list of
// resource Amazon Resource Names (ARNs), or include all resources of a specified
// resource type.
//
// This member is required.
Pattern types.ProtectionGroupPattern
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
// The Amazon Resource Names (ARNs) of the resources to include in the protection
// group. You must set this when you set Pattern to ARBITRARY and you must not set
// it for any other Pattern setting.
Members []string
// The resource type to include in the protection group. All protected resources
// of this type are included in the protection group. You must set this when you
// set Pattern to BY_RESOURCE_TYPE and you must not set it for any other Pattern
// setting.
ResourceType types.ProtectedResourceType
noSmithyDocumentSerde
}
type UpdateProtectionGroupOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateProtectionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateProtectionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateProtectionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateProtectionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProtectionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateProtectionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "UpdateProtectionGroup",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the details of an existing subscription. Only enter values for
// parameters you want to change. Empty parameters are not updated. For accounts
// that are members of an Organizations organization, Shield Advanced subscriptions
// are billed against the organization's payer account, regardless of whether the
// payer account itself is subscribed.
func (c *Client) UpdateSubscription(ctx context.Context, params *UpdateSubscriptionInput, optFns ...func(*Options)) (*UpdateSubscriptionOutput, error) {
if params == nil {
params = &UpdateSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSubscription", params, optFns, c.addOperationUpdateSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSubscriptionInput struct {
// When you initally create a subscription, AutoRenew is set to ENABLED . If
// ENABLED , the subscription will be automatically renewed at the end of the
// existing subscription period. You can change this by submitting an
// UpdateSubscription request. If the UpdateSubscription request does not included
// a value for AutoRenew , the existing value for AutoRenew remains unchanged.
AutoRenew types.AutoRenew
noSmithyDocumentSerde
}
type UpdateSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "shield",
OperationName: "UpdateSubscription",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/shield/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"
"math"
"strings"
)
type awsAwsjson11_deserializeOpAssociateDRTLogBucket struct {
}
func (*awsAwsjson11_deserializeOpAssociateDRTLogBucket) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateDRTLogBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAssociateDRTLogBucket(response, &metadata)
}
output := &AssociateDRTLogBucketOutput{}
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_deserializeOpDocumentAssociateDRTLogBucketOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorAssociateDRTLogBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedForDependencyException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody)
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("LimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitsExceededException(response, errorBody)
case strings.EqualFold("NoAssociatedRoleException", errorCode):
return awsAwsjson11_deserializeErrorNoAssociatedRoleException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAssociateDRTRole struct {
}
func (*awsAwsjson11_deserializeOpAssociateDRTRole) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateDRTRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAssociateDRTRole(response, &metadata)
}
output := &AssociateDRTRoleOutput{}
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_deserializeOpDocumentAssociateDRTRoleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorAssociateDRTRole(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedForDependencyException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody)
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAssociateHealthCheck struct {
}
func (*awsAwsjson11_deserializeOpAssociateHealthCheck) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAssociateHealthCheck(response, &metadata)
}
output := &AssociateHealthCheckOutput{}
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_deserializeOpDocumentAssociateHealthCheckOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorAssociateHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("LimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitsExceededException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAssociateProactiveEngagementDetails struct {
}
func (*awsAwsjson11_deserializeOpAssociateProactiveEngagementDetails) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateProactiveEngagementDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAssociateProactiveEngagementDetails(response, &metadata)
}
output := &AssociateProactiveEngagementDetailsOutput{}
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_deserializeOpDocumentAssociateProactiveEngagementDetailsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorAssociateProactiveEngagementDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateProtection struct {
}
func (*awsAwsjson11_deserializeOpCreateProtection) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateProtection(response, &metadata)
}
output := &CreateProtectionOutput{}
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_deserializeOpDocumentCreateProtectionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("LimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitsExceededException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateProtectionGroup struct {
}
func (*awsAwsjson11_deserializeOpCreateProtectionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateProtectionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateProtectionGroup(response, &metadata)
}
output := &CreateProtectionGroupOutput{}
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_deserializeOpDocumentCreateProtectionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateProtectionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("LimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitsExceededException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSubscription struct {
}
func (*awsAwsjson11_deserializeOpCreateSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateSubscription(response, &metadata)
}
output := &CreateSubscriptionOutput{}
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_deserializeOpDocumentCreateSubscriptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorCreateSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteProtection struct {
}
func (*awsAwsjson11_deserializeOpDeleteProtection) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteProtection(response, &metadata)
}
output := &DeleteProtectionOutput{}
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_deserializeOpDocumentDeleteProtectionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteProtectionGroup struct {
}
func (*awsAwsjson11_deserializeOpDeleteProtectionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteProtectionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteProtectionGroup(response, &metadata)
}
output := &DeleteProtectionGroupOutput{}
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_deserializeOpDocumentDeleteProtectionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteProtectionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSubscription struct {
}
func (*awsAwsjson11_deserializeOpDeleteSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteSubscription(response, &metadata)
}
output := &DeleteSubscriptionOutput{}
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_deserializeOpDocumentDeleteSubscriptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDeleteSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("LockedSubscriptionException", errorCode):
return awsAwsjson11_deserializeErrorLockedSubscriptionException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAttack struct {
}
func (*awsAwsjson11_deserializeOpDescribeAttack) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAttack) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeAttack(response, &metadata)
}
output := &DescribeAttackOutput{}
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_deserializeOpDocumentDescribeAttackOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeAttack(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAttackStatistics struct {
}
func (*awsAwsjson11_deserializeOpDescribeAttackStatistics) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAttackStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeAttackStatistics(response, &metadata)
}
output := &DescribeAttackStatisticsOutput{}
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_deserializeOpDocumentDescribeAttackStatisticsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeAttackStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeDRTAccess struct {
}
func (*awsAwsjson11_deserializeOpDescribeDRTAccess) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeDRTAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeDRTAccess(response, &metadata)
}
output := &DescribeDRTAccessOutput{}
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_deserializeOpDocumentDescribeDRTAccessOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeDRTAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeEmergencyContactSettings struct {
}
func (*awsAwsjson11_deserializeOpDescribeEmergencyContactSettings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeEmergencyContactSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeEmergencyContactSettings(response, &metadata)
}
output := &DescribeEmergencyContactSettingsOutput{}
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_deserializeOpDocumentDescribeEmergencyContactSettingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeEmergencyContactSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeProtection struct {
}
func (*awsAwsjson11_deserializeOpDescribeProtection) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeProtection(response, &metadata)
}
output := &DescribeProtectionOutput{}
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_deserializeOpDocumentDescribeProtectionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeProtectionGroup struct {
}
func (*awsAwsjson11_deserializeOpDescribeProtectionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeProtectionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeProtectionGroup(response, &metadata)
}
output := &DescribeProtectionGroupOutput{}
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_deserializeOpDocumentDescribeProtectionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeProtectionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeSubscription struct {
}
func (*awsAwsjson11_deserializeOpDescribeSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeSubscription(response, &metadata)
}
output := &DescribeSubscriptionOutput{}
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_deserializeOpDocumentDescribeSubscriptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDescribeSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisableApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_deserializeOpDisableApplicationLayerAutomaticResponse) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisableApplicationLayerAutomaticResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisableApplicationLayerAutomaticResponse(response, &metadata)
}
output := &DisableApplicationLayerAutomaticResponseOutput{}
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_deserializeOpDocumentDisableApplicationLayerAutomaticResponseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDisableApplicationLayerAutomaticResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisableProactiveEngagement struct {
}
func (*awsAwsjson11_deserializeOpDisableProactiveEngagement) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisableProactiveEngagement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisableProactiveEngagement(response, &metadata)
}
output := &DisableProactiveEngagementOutput{}
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_deserializeOpDocumentDisableProactiveEngagementOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDisableProactiveEngagement(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisassociateDRTLogBucket struct {
}
func (*awsAwsjson11_deserializeOpDisassociateDRTLogBucket) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisassociateDRTLogBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisassociateDRTLogBucket(response, &metadata)
}
output := &DisassociateDRTLogBucketOutput{}
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_deserializeOpDocumentDisassociateDRTLogBucketOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDisassociateDRTLogBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedForDependencyException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody)
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("NoAssociatedRoleException", errorCode):
return awsAwsjson11_deserializeErrorNoAssociatedRoleException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisassociateDRTRole struct {
}
func (*awsAwsjson11_deserializeOpDisassociateDRTRole) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisassociateDRTRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisassociateDRTRole(response, &metadata)
}
output := &DisassociateDRTRoleOutput{}
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_deserializeOpDocumentDisassociateDRTRoleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDisassociateDRTRole(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisassociateHealthCheck struct {
}
func (*awsAwsjson11_deserializeOpDisassociateHealthCheck) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisassociateHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisassociateHealthCheck(response, &metadata)
}
output := &DisassociateHealthCheckOutput{}
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_deserializeOpDocumentDisassociateHealthCheckOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorDisassociateHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpEnableApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_deserializeOpEnableApplicationLayerAutomaticResponse) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpEnableApplicationLayerAutomaticResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorEnableApplicationLayerAutomaticResponse(response, &metadata)
}
output := &EnableApplicationLayerAutomaticResponseOutput{}
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_deserializeOpDocumentEnableApplicationLayerAutomaticResponseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorEnableApplicationLayerAutomaticResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("LimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitsExceededException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpEnableProactiveEngagement struct {
}
func (*awsAwsjson11_deserializeOpEnableProactiveEngagement) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpEnableProactiveEngagement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorEnableProactiveEngagement(response, &metadata)
}
output := &EnableProactiveEngagementOutput{}
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_deserializeOpDocumentEnableProactiveEngagementOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorEnableProactiveEngagement(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSubscriptionState struct {
}
func (*awsAwsjson11_deserializeOpGetSubscriptionState) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSubscriptionState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetSubscriptionState(response, &metadata)
}
output := &GetSubscriptionStateOutput{}
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_deserializeOpDocumentGetSubscriptionStateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorGetSubscriptionState(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAttacks struct {
}
func (*awsAwsjson11_deserializeOpListAttacks) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAttacks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListAttacks(response, &metadata)
}
output := &ListAttacksOutput{}
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_deserializeOpDocumentListAttacksOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListAttacks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListProtectionGroups struct {
}
func (*awsAwsjson11_deserializeOpListProtectionGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListProtectionGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListProtectionGroups(response, &metadata)
}
output := &ListProtectionGroupsOutput{}
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_deserializeOpDocumentListProtectionGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListProtectionGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsAwsjson11_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListProtections struct {
}
func (*awsAwsjson11_deserializeOpListProtections) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListProtections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListProtections(response, &metadata)
}
output := &ListProtectionsOutput{}
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_deserializeOpDocumentListProtectionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListProtections(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsAwsjson11_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListResourcesInProtectionGroup struct {
}
func (*awsAwsjson11_deserializeOpListResourcesInProtectionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListResourcesInProtectionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListResourcesInProtectionGroup(response, &metadata)
}
output := &ListResourcesInProtectionGroupOutput{}
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_deserializeOpDocumentListResourcesInProtectionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorListResourcesInProtectionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidPaginationTokenException", errorCode):
return awsAwsjson11_deserializeErrorInvalidPaginationTokenException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("InvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_deserializeOpUpdateApplicationLayerAutomaticResponse) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateApplicationLayerAutomaticResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateApplicationLayerAutomaticResponse(response, &metadata)
}
output := &UpdateApplicationLayerAutomaticResponseOutput{}
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_deserializeOpDocumentUpdateApplicationLayerAutomaticResponseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateApplicationLayerAutomaticResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateEmergencyContactSettings struct {
}
func (*awsAwsjson11_deserializeOpUpdateEmergencyContactSettings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateEmergencyContactSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateEmergencyContactSettings(response, &metadata)
}
output := &UpdateEmergencyContactSettingsOutput{}
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_deserializeOpDocumentUpdateEmergencyContactSettingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateEmergencyContactSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateProtectionGroup struct {
}
func (*awsAwsjson11_deserializeOpUpdateProtectionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateProtectionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateProtectionGroup(response, &metadata)
}
output := &UpdateProtectionGroupOutput{}
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_deserializeOpDocumentUpdateProtectionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateProtectionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateSubscription struct {
}
func (*awsAwsjson11_deserializeOpUpdateSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateSubscription(response, &metadata)
}
output := &UpdateSubscriptionOutput{}
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_deserializeOpDocumentUpdateSubscriptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
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_deserializeOpErrorUpdateSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody)
case strings.EqualFold("InvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
case strings.EqualFold("LockedSubscriptionException", errorCode):
return awsAwsjson11_deserializeErrorLockedSubscriptionException(response, errorBody)
case strings.EqualFold("OptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorOptimisticLockException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.AccessDeniedException{}
err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.AccessDeniedForDependencyException{}
err := awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInternalErrorException(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.InternalErrorException{}
err := awsAwsjson11_deserializeDocumentInternalErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidOperationException(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.InvalidOperationException{}
err := awsAwsjson11_deserializeDocumentInvalidOperationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorInvalidPaginationTokenException(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.InvalidPaginationTokenException{}
err := awsAwsjson11_deserializeDocumentInvalidPaginationTokenException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func 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_deserializeErrorInvalidResourceException(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.InvalidResourceException{}
err := awsAwsjson11_deserializeDocumentInvalidResourceException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorLimitsExceededException(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.LimitsExceededException{}
err := awsAwsjson11_deserializeDocumentLimitsExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorLockedSubscriptionException(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.LockedSubscriptionException{}
err := awsAwsjson11_deserializeDocumentLockedSubscriptionException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorNoAssociatedRoleException(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.NoAssociatedRoleException{}
err := awsAwsjson11_deserializeDocumentNoAssociatedRoleException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorOptimisticLockException(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.OptimisticLockException{}
err := awsAwsjson11_deserializeDocumentOptimisticLockException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_deserializeErrorResourceAlreadyExistsException(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.ResourceAlreadyExistsException{}
err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceNotFoundException{}
err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(v **types.AccessDeniedForDependencyException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedForDependencyException
if *v == nil {
sv = &types.AccessDeniedForDependencyException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentApplicationLayerAutomaticResponseConfiguration(v **types.ApplicationLayerAutomaticResponseConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationLayerAutomaticResponseConfiguration
if *v == nil {
sv = &types.ApplicationLayerAutomaticResponseConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if err := awsAwsjson11_deserializeDocumentResponseAction(&sv.Action, value); err != nil {
return err
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationLayerAutomaticResponseStatus to be of type string, got %T instead", value)
}
sv.Status = types.ApplicationLayerAutomaticResponseStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackDetail(v **types.AttackDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackDetail
if *v == nil {
sv = &types.AttackDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackCounters":
if err := awsAwsjson11_deserializeDocumentSummarizedCounterList(&sv.AttackCounters, value); err != nil {
return err
}
case "AttackId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttackId to be of type string, got %T instead", value)
}
sv.AttackId = ptr.String(jtv)
}
case "AttackProperties":
if err := awsAwsjson11_deserializeDocumentAttackProperties(&sv.AttackProperties, value); err != nil {
return err
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected AttackTimestamp to be a JSON Number, got %T instead", value)
}
}
case "Mitigations":
if err := awsAwsjson11_deserializeDocumentMitigationList(&sv.Mitigations, value); err != nil {
return err
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected AttackTimestamp to be a JSON Number, got %T instead", value)
}
}
case "SubResources":
if err := awsAwsjson11_deserializeDocumentSubResourceSummaryList(&sv.SubResources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackProperties(v *[]types.AttackProperty, 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.AttackProperty
if *v == nil {
cv = []types.AttackProperty{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AttackProperty
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttackProperty(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAttackProperty(v **types.AttackProperty, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackProperty
if *v == nil {
sv = &types.AttackProperty{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackLayer":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttackLayer to be of type string, got %T instead", value)
}
sv.AttackLayer = types.AttackLayer(jtv)
}
case "AttackPropertyIdentifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttackPropertyIdentifier to be of type string, got %T instead", value)
}
sv.AttackPropertyIdentifier = types.AttackPropertyIdentifier(jtv)
}
case "TopContributors":
if err := awsAwsjson11_deserializeDocumentTopContributors(&sv.TopContributors, value); err != nil {
return err
}
case "Total":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Total = i64
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Unit to be of type string, got %T instead", value)
}
sv.Unit = types.Unit(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackStatisticsDataItem(v **types.AttackStatisticsDataItem, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackStatisticsDataItem
if *v == nil {
sv = &types.AttackStatisticsDataItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AttackCount = i64
}
case "AttackVolume":
if err := awsAwsjson11_deserializeDocumentAttackVolume(&sv.AttackVolume, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackStatisticsDataList(v *[]types.AttackStatisticsDataItem, 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.AttackStatisticsDataItem
if *v == nil {
cv = []types.AttackStatisticsDataItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AttackStatisticsDataItem
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttackStatisticsDataItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAttackSummaries(v *[]types.AttackSummary, 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.AttackSummary
if *v == nil {
cv = []types.AttackSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AttackSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttackSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAttackSummary(v **types.AttackSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackSummary
if *v == nil {
sv = &types.AttackSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.AttackId = ptr.String(jtv)
}
case "AttackVectors":
if err := awsAwsjson11_deserializeDocumentAttackVectorDescriptionList(&sv.AttackVectors, value); err != nil {
return err
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected AttackTimestamp to be a JSON Number, got %T instead", value)
}
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected AttackTimestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackVectorDescription(v **types.AttackVectorDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackVectorDescription
if *v == nil {
sv = &types.AttackVectorDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "VectorType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VectorType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackVectorDescriptionList(v *[]types.AttackVectorDescription, 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.AttackVectorDescription
if *v == nil {
cv = []types.AttackVectorDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AttackVectorDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttackVectorDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAttackVolume(v **types.AttackVolume, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackVolume
if *v == nil {
sv = &types.AttackVolume{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BitsPerSecond":
if err := awsAwsjson11_deserializeDocumentAttackVolumeStatistics(&sv.BitsPerSecond, value); err != nil {
return err
}
case "PacketsPerSecond":
if err := awsAwsjson11_deserializeDocumentAttackVolumeStatistics(&sv.PacketsPerSecond, value); err != nil {
return err
}
case "RequestsPerSecond":
if err := awsAwsjson11_deserializeDocumentAttackVolumeStatistics(&sv.RequestsPerSecond, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttackVolumeStatistics(v **types.AttackVolumeStatistics, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttackVolumeStatistics
if *v == nil {
sv = &types.AttackVolumeStatistics{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Max":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Max = 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.Max = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBlockAction(v **types.BlockAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BlockAction
if *v == nil {
sv = &types.BlockAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentContributor(v **types.Contributor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Contributor
if *v == nil {
sv = &types.Contributor{}
} 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 String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Value = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCountAction(v **types.CountAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CountAction
if *v == nil {
sv = &types.CountAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEmergencyContact(v **types.EmergencyContact, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EmergencyContact
if *v == nil {
sv = &types.EmergencyContact{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactNotes":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactNotes to be of type string, got %T instead", value)
}
sv.ContactNotes = ptr.String(jtv)
}
case "EmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "PhoneNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value)
}
sv.PhoneNumber = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEmergencyContactList(v *[]types.EmergencyContact, 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.EmergencyContact
if *v == nil {
cv = []types.EmergencyContact{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EmergencyContact
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEmergencyContact(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHealthCheckIds(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 HealthCheckId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInternalErrorException(v **types.InternalErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalErrorException
if *v == nil {
sv = &types.InternalErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidOperationException(v **types.InvalidOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidOperationException
if *v == nil {
sv = &types.InvalidOperationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidPaginationTokenException
if *v == nil {
sv = &types.InvalidPaginationTokenException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func 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 "fields":
if err := awsAwsjson11_deserializeDocumentValidationExceptionFieldList(&sv.Fields, value); err != nil {
return err
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value)
}
sv.Reason = types.ValidationExceptionReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidResourceException(v **types.InvalidResourceException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidResourceException
if *v == nil {
sv = &types.InvalidResourceException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLimit(v **types.Limit, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Limit
if *v == nil {
sv = &types.Limit{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Max":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Max = i64
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLimits(v *[]types.Limit, 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.Limit
if *v == nil {
cv = []types.Limit{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Limit
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLimit(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLimitsExceededException(v **types.LimitsExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitsExceededException
if *v == nil {
sv = &types.LimitsExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Limit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected LimitNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Limit = i64
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LimitType to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLockedSubscriptionException(v **types.LockedSubscriptionException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LockedSubscriptionException
if *v == nil {
sv = &types.LockedSubscriptionException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLogBucketList(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 LogBucket to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentMitigation(v **types.Mitigation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Mitigation
if *v == nil {
sv = &types.Mitigation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MitigationName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.MitigationName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMitigationList(v *[]types.Mitigation, 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.Mitigation
if *v == nil {
cv = []types.Mitigation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Mitigation
destAddr := &col
if err := awsAwsjson11_deserializeDocumentMitigation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNoAssociatedRoleException(v **types.NoAssociatedRoleException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NoAssociatedRoleException
if *v == nil {
sv = &types.NoAssociatedRoleException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOptimisticLockException(v **types.OptimisticLockException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OptimisticLockException
if *v == nil {
sv = &types.OptimisticLockException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtection(v **types.Protection, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Protection
if *v == nil {
sv = &types.Protection{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationLayerAutomaticResponseConfiguration":
if err := awsAwsjson11_deserializeDocumentApplicationLayerAutomaticResponseConfiguration(&sv.ApplicationLayerAutomaticResponseConfiguration, value); err != nil {
return err
}
case "HealthCheckIds":
if err := awsAwsjson11_deserializeDocumentHealthCheckIds(&sv.HealthCheckIds, value); err != nil {
return err
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectionId 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 ProtectionName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ProtectionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ProtectionArn = ptr.String(jtv)
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroup(v **types.ProtectionGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProtectionGroup
if *v == nil {
sv = &types.ProtectionGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Aggregation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectionGroupAggregation to be of type string, got %T instead", value)
}
sv.Aggregation = types.ProtectionGroupAggregation(jtv)
}
case "Members":
if err := awsAwsjson11_deserializeDocumentProtectionGroupMembers(&sv.Members, value); err != nil {
return err
}
case "Pattern":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectionGroupPattern to be of type string, got %T instead", value)
}
sv.Pattern = types.ProtectionGroupPattern(jtv)
}
case "ProtectionGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ProtectionGroupArn = ptr.String(jtv)
}
case "ProtectionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectionGroupId to be of type string, got %T instead", value)
}
sv.ProtectionGroupId = ptr.String(jtv)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectedResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ProtectedResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroupArbitraryPatternLimits(v **types.ProtectionGroupArbitraryPatternLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProtectionGroupArbitraryPatternLimits
if *v == nil {
sv = &types.ProtectionGroupArbitraryPatternLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaxMembers":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxMembers = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroupLimits(v **types.ProtectionGroupLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProtectionGroupLimits
if *v == nil {
sv = &types.ProtectionGroupLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaxProtectionGroups":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxProtectionGroups = i64
}
case "PatternTypeLimits":
if err := awsAwsjson11_deserializeDocumentProtectionGroupPatternTypeLimits(&sv.PatternTypeLimits, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroupMembers(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 ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroupPatternTypeLimits(v **types.ProtectionGroupPatternTypeLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProtectionGroupPatternTypeLimits
if *v == nil {
sv = &types.ProtectionGroupPatternTypeLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ArbitraryPatternLimits":
if err := awsAwsjson11_deserializeDocumentProtectionGroupArbitraryPatternLimits(&sv.ArbitraryPatternLimits, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionGroups(v *[]types.ProtectionGroup, 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.ProtectionGroup
if *v == nil {
cv = []types.ProtectionGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ProtectionGroup
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProtectionGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProtectionLimits(v **types.ProtectionLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProtectionLimits
if *v == nil {
sv = &types.ProtectionLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProtectedResourceTypeLimits":
if err := awsAwsjson11_deserializeDocumentLimits(&sv.ProtectedResourceTypeLimits, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProtections(v *[]types.Protection, 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.Protection
if *v == nil {
cv = []types.Protection{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Protection
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProtection(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceAlreadyExistsException
if *v == nil {
sv = &types.ResourceAlreadyExistsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceArnList(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 ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseAction(v **types.ResponseAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseAction
if *v == nil {
sv = &types.ResponseAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Block":
if err := awsAwsjson11_deserializeDocumentBlockAction(&sv.Block, value); err != nil {
return err
}
case "Count":
if err := awsAwsjson11_deserializeDocumentCountAction(&sv.Count, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubResourceSummary(v **types.SubResourceSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SubResourceSummary
if *v == nil {
sv = &types.SubResourceSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackVectors":
if err := awsAwsjson11_deserializeDocumentSummarizedAttackVectorList(&sv.AttackVectors, value); err != nil {
return err
}
case "Counters":
if err := awsAwsjson11_deserializeDocumentSummarizedCounterList(&sv.Counters, value); err != nil {
return err
}
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 "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubResourceType to be of type string, got %T instead", value)
}
sv.Type = types.SubResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubResourceSummaryList(v *[]types.SubResourceSummary, 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.SubResourceSummary
if *v == nil {
cv = []types.SubResourceSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SubResourceSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSubResourceSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubscription(v **types.Subscription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Subscription
if *v == nil {
sv = &types.Subscription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutoRenew":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoRenew to be of type string, got %T instead", value)
}
sv.AutoRenew = types.AutoRenew(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Limits":
if err := awsAwsjson11_deserializeDocumentLimits(&sv.Limits, value); err != nil {
return err
}
case "ProactiveEngagementStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProactiveEngagementStatus to be of type string, got %T instead", value)
}
sv.ProactiveEngagementStatus = types.ProactiveEngagementStatus(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "SubscriptionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.SubscriptionArn = ptr.String(jtv)
}
case "SubscriptionLimits":
if err := awsAwsjson11_deserializeDocumentSubscriptionLimits(&sv.SubscriptionLimits, value); err != nil {
return err
}
case "TimeCommitmentInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected DurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeCommitmentInSeconds = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubscriptionLimits(v **types.SubscriptionLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SubscriptionLimits
if *v == nil {
sv = &types.SubscriptionLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProtectionGroupLimits":
if err := awsAwsjson11_deserializeDocumentProtectionGroupLimits(&sv.ProtectionGroupLimits, value); err != nil {
return err
}
case "ProtectionLimits":
if err := awsAwsjson11_deserializeDocumentProtectionLimits(&sv.ProtectionLimits, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSummarizedAttackVector(v **types.SummarizedAttackVector, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SummarizedAttackVector
if *v == nil {
sv = &types.SummarizedAttackVector{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "VectorCounters":
if err := awsAwsjson11_deserializeDocumentSummarizedCounterList(&sv.VectorCounters, value); err != nil {
return err
}
case "VectorType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VectorType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSummarizedAttackVectorList(v *[]types.SummarizedAttackVector, 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.SummarizedAttackVector
if *v == nil {
cv = []types.SummarizedAttackVector{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SummarizedAttackVector
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSummarizedAttackVector(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSummarizedCounter(v **types.SummarizedCounter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SummarizedCounter
if *v == nil {
sv = &types.SummarizedCounter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Average":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Average = 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.Average = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Max":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Max = 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.Max = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "N":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.N = int32(i64)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Sum":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Sum = 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.Sum = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Unit = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSummarizedCounterList(v *[]types.SummarizedCounter, 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.SummarizedCounter
if *v == nil {
cv = []types.SummarizedCounter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SummarizedCounter
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSummarizedCounter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTimeRange(v **types.TimeRange, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TimeRange
if *v == nil {
sv = &types.TimeRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FromInclusive":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.FromInclusive = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ToExclusive":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ToExclusive = 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 awsAwsjson11_deserializeDocumentTopContributors(v *[]types.Contributor, 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.Contributor
if *v == nil {
cv = []types.Contributor{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Contributor
destAddr := &col
if err := awsAwsjson11_deserializeDocumentContributor(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationExceptionField
if *v == nil {
sv = &types.ValidationExceptionField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ValidationExceptionField
if *v == nil {
cv = []types.ValidationExceptionField{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ValidationExceptionField
destAddr := &col
if err := awsAwsjson11_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateDRTLogBucketOutput(v **AssociateDRTLogBucketOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateDRTLogBucketOutput
if *v == nil {
sv = &AssociateDRTLogBucketOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateDRTRoleOutput(v **AssociateDRTRoleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateDRTRoleOutput
if *v == nil {
sv = &AssociateDRTRoleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateHealthCheckOutput(v **AssociateHealthCheckOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateHealthCheckOutput
if *v == nil {
sv = &AssociateHealthCheckOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateProactiveEngagementDetailsOutput(v **AssociateProactiveEngagementDetailsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateProactiveEngagementDetailsOutput
if *v == nil {
sv = &AssociateProactiveEngagementDetailsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateProtectionGroupOutput(v **CreateProtectionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateProtectionGroupOutput
if *v == nil {
sv = &CreateProtectionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateProtectionOutput(v **CreateProtectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateProtectionOutput
if *v == nil {
sv = &CreateProtectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProtectionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProtectionId to be of type string, got %T instead", value)
}
sv.ProtectionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSubscriptionOutput(v **CreateSubscriptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSubscriptionOutput
if *v == nil {
sv = &CreateSubscriptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteProtectionGroupOutput(v **DeleteProtectionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteProtectionGroupOutput
if *v == nil {
sv = &DeleteProtectionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteProtectionOutput(v **DeleteProtectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteProtectionOutput
if *v == nil {
sv = &DeleteProtectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSubscriptionOutput(v **DeleteSubscriptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSubscriptionOutput
if *v == nil {
sv = &DeleteSubscriptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAttackOutput(v **DescribeAttackOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAttackOutput
if *v == nil {
sv = &DescribeAttackOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Attack":
if err := awsAwsjson11_deserializeDocumentAttackDetail(&sv.Attack, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAttackStatisticsOutput(v **DescribeAttackStatisticsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAttackStatisticsOutput
if *v == nil {
sv = &DescribeAttackStatisticsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataItems":
if err := awsAwsjson11_deserializeDocumentAttackStatisticsDataList(&sv.DataItems, value); err != nil {
return err
}
case "TimeRange":
if err := awsAwsjson11_deserializeDocumentTimeRange(&sv.TimeRange, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeDRTAccessOutput(v **DescribeDRTAccessOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeDRTAccessOutput
if *v == nil {
sv = &DescribeDRTAccessOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LogBucketList":
if err := awsAwsjson11_deserializeDocumentLogBucketList(&sv.LogBucketList, value); err != nil {
return err
}
case "RoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeEmergencyContactSettingsOutput(v **DescribeEmergencyContactSettingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeEmergencyContactSettingsOutput
if *v == nil {
sv = &DescribeEmergencyContactSettingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EmergencyContactList":
if err := awsAwsjson11_deserializeDocumentEmergencyContactList(&sv.EmergencyContactList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeProtectionGroupOutput(v **DescribeProtectionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeProtectionGroupOutput
if *v == nil {
sv = &DescribeProtectionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProtectionGroup":
if err := awsAwsjson11_deserializeDocumentProtectionGroup(&sv.ProtectionGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeProtectionOutput(v **DescribeProtectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeProtectionOutput
if *v == nil {
sv = &DescribeProtectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Protection":
if err := awsAwsjson11_deserializeDocumentProtection(&sv.Protection, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeSubscriptionOutput(v **DescribeSubscriptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeSubscriptionOutput
if *v == nil {
sv = &DescribeSubscriptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Subscription":
if err := awsAwsjson11_deserializeDocumentSubscription(&sv.Subscription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisableApplicationLayerAutomaticResponseOutput(v **DisableApplicationLayerAutomaticResponseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisableApplicationLayerAutomaticResponseOutput
if *v == nil {
sv = &DisableApplicationLayerAutomaticResponseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisableProactiveEngagementOutput(v **DisableProactiveEngagementOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisableProactiveEngagementOutput
if *v == nil {
sv = &DisableProactiveEngagementOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisassociateDRTLogBucketOutput(v **DisassociateDRTLogBucketOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisassociateDRTLogBucketOutput
if *v == nil {
sv = &DisassociateDRTLogBucketOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisassociateDRTRoleOutput(v **DisassociateDRTRoleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisassociateDRTRoleOutput
if *v == nil {
sv = &DisassociateDRTRoleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisassociateHealthCheckOutput(v **DisassociateHealthCheckOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisassociateHealthCheckOutput
if *v == nil {
sv = &DisassociateHealthCheckOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentEnableApplicationLayerAutomaticResponseOutput(v **EnableApplicationLayerAutomaticResponseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *EnableApplicationLayerAutomaticResponseOutput
if *v == nil {
sv = &EnableApplicationLayerAutomaticResponseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentEnableProactiveEngagementOutput(v **EnableProactiveEngagementOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *EnableProactiveEngagementOutput
if *v == nil {
sv = &EnableProactiveEngagementOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSubscriptionStateOutput(v **GetSubscriptionStateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSubscriptionStateOutput
if *v == nil {
sv = &GetSubscriptionStateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SubscriptionState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubscriptionState to be of type string, got %T instead", value)
}
sv.SubscriptionState = types.SubscriptionState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAttacksOutput(v **ListAttacksOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAttacksOutput
if *v == nil {
sv = &ListAttacksOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttackSummaries":
if err := awsAwsjson11_deserializeDocumentAttackSummaries(&sv.AttackSummaries, 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
}
func awsAwsjson11_deserializeOpDocumentListProtectionGroupsOutput(v **ListProtectionGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListProtectionGroupsOutput
if *v == nil {
sv = &ListProtectionGroupsOutput{}
} 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 "ProtectionGroups":
if err := awsAwsjson11_deserializeDocumentProtectionGroups(&sv.ProtectionGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListProtectionsOutput(v **ListProtectionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListProtectionsOutput
if *v == nil {
sv = &ListProtectionsOutput{}
} 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 "Protections":
if err := awsAwsjson11_deserializeDocumentProtections(&sv.Protections, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListResourcesInProtectionGroupOutput(v **ListResourcesInProtectionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListResourcesInProtectionGroupOutput
if *v == nil {
sv = &ListResourcesInProtectionGroupOutput{}
} 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 "ResourceArns":
if err := awsAwsjson11_deserializeDocumentResourceArnList(&sv.ResourceArns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateApplicationLayerAutomaticResponseOutput(v **UpdateApplicationLayerAutomaticResponseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateApplicationLayerAutomaticResponseOutput
if *v == nil {
sv = &UpdateApplicationLayerAutomaticResponseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateEmergencyContactSettingsOutput(v **UpdateEmergencyContactSettingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateEmergencyContactSettingsOutput
if *v == nil {
sv = &UpdateEmergencyContactSettingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateProtectionGroupOutput(v **UpdateProtectionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateProtectionGroupOutput
if *v == nil {
sv = &UpdateProtectionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateSubscriptionOutput(v **UpdateSubscriptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSubscriptionOutput
if *v == nil {
sv = &UpdateSubscriptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 8,984 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package shield provides the API client, operations, and parameter types for AWS
// Shield.
//
// Shield Advanced This is the Shield Advanced API Reference. This guide is for
// developers who need detailed information about the Shield Advanced API actions,
// data types, and errors. For detailed information about WAF and Shield Advanced
// features and an overview of how to use the WAF and Shield Advanced APIs, see the
// WAF and Shield Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
package shield
| 13 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
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/shield/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 = "shield"
}
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 shield
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/shield/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAssociateDRTLogBucket struct {
}
func (*awsAwsjson11_serializeOpAssociateDRTLogBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateDRTLogBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateDRTLogBucketInput)
_ = 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("AWSShield_20160616.AssociateDRTLogBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateDRTLogBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAssociateDRTRole struct {
}
func (*awsAwsjson11_serializeOpAssociateDRTRole) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateDRTRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateDRTRoleInput)
_ = 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("AWSShield_20160616.AssociateDRTRole")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateDRTRoleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAssociateHealthCheck struct {
}
func (*awsAwsjson11_serializeOpAssociateHealthCheck) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateHealthCheck) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateHealthCheckInput)
_ = 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("AWSShield_20160616.AssociateHealthCheck")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateHealthCheckInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAssociateProactiveEngagementDetails struct {
}
func (*awsAwsjson11_serializeOpAssociateProactiveEngagementDetails) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateProactiveEngagementDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateProactiveEngagementDetailsInput)
_ = 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("AWSShield_20160616.AssociateProactiveEngagementDetails")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateProactiveEngagementDetailsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateProtection struct {
}
func (*awsAwsjson11_serializeOpCreateProtection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateProtection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateProtectionInput)
_ = 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("AWSShield_20160616.CreateProtection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateProtectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateProtectionGroup struct {
}
func (*awsAwsjson11_serializeOpCreateProtectionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateProtectionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateProtectionGroupInput)
_ = 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("AWSShield_20160616.CreateProtectionGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateProtectionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateSubscription struct {
}
func (*awsAwsjson11_serializeOpCreateSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSubscriptionInput)
_ = 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("AWSShield_20160616.CreateSubscription")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteProtection struct {
}
func (*awsAwsjson11_serializeOpDeleteProtection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteProtection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteProtectionInput)
_ = 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("AWSShield_20160616.DeleteProtection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteProtectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteProtectionGroup struct {
}
func (*awsAwsjson11_serializeOpDeleteProtectionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteProtectionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteProtectionGroupInput)
_ = 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("AWSShield_20160616.DeleteProtectionGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteProtectionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteSubscription struct {
}
func (*awsAwsjson11_serializeOpDeleteSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSubscriptionInput)
_ = 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("AWSShield_20160616.DeleteSubscription")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeAttack struct {
}
func (*awsAwsjson11_serializeOpDescribeAttack) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAttack) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAttackInput)
_ = 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("AWSShield_20160616.DescribeAttack")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAttackInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeAttackStatistics struct {
}
func (*awsAwsjson11_serializeOpDescribeAttackStatistics) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAttackStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAttackStatisticsInput)
_ = 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("AWSShield_20160616.DescribeAttackStatistics")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAttackStatisticsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeDRTAccess struct {
}
func (*awsAwsjson11_serializeOpDescribeDRTAccess) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeDRTAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeDRTAccessInput)
_ = 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("AWSShield_20160616.DescribeDRTAccess")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeDRTAccessInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeEmergencyContactSettings struct {
}
func (*awsAwsjson11_serializeOpDescribeEmergencyContactSettings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeEmergencyContactSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeEmergencyContactSettingsInput)
_ = 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("AWSShield_20160616.DescribeEmergencyContactSettings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeEmergencyContactSettingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeProtection struct {
}
func (*awsAwsjson11_serializeOpDescribeProtection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeProtection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeProtectionInput)
_ = 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("AWSShield_20160616.DescribeProtection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeProtectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeProtectionGroup struct {
}
func (*awsAwsjson11_serializeOpDescribeProtectionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeProtectionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeProtectionGroupInput)
_ = 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("AWSShield_20160616.DescribeProtectionGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeProtectionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDescribeSubscription struct {
}
func (*awsAwsjson11_serializeOpDescribeSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSubscriptionInput)
_ = 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("AWSShield_20160616.DescribeSubscription")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisableApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_serializeOpDisableApplicationLayerAutomaticResponse) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisableApplicationLayerAutomaticResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableApplicationLayerAutomaticResponseInput)
_ = 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("AWSShield_20160616.DisableApplicationLayerAutomaticResponse")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisableApplicationLayerAutomaticResponseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisableProactiveEngagement struct {
}
func (*awsAwsjson11_serializeOpDisableProactiveEngagement) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisableProactiveEngagement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableProactiveEngagementInput)
_ = 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("AWSShield_20160616.DisableProactiveEngagement")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisableProactiveEngagementInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisassociateDRTLogBucket struct {
}
func (*awsAwsjson11_serializeOpDisassociateDRTLogBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateDRTLogBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateDRTLogBucketInput)
_ = 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("AWSShield_20160616.DisassociateDRTLogBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateDRTLogBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisassociateDRTRole struct {
}
func (*awsAwsjson11_serializeOpDisassociateDRTRole) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateDRTRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateDRTRoleInput)
_ = 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("AWSShield_20160616.DisassociateDRTRole")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateDRTRoleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisassociateHealthCheck struct {
}
func (*awsAwsjson11_serializeOpDisassociateHealthCheck) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateHealthCheck) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateHealthCheckInput)
_ = 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("AWSShield_20160616.DisassociateHealthCheck")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateHealthCheckInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpEnableApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_serializeOpEnableApplicationLayerAutomaticResponse) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpEnableApplicationLayerAutomaticResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EnableApplicationLayerAutomaticResponseInput)
_ = 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("AWSShield_20160616.EnableApplicationLayerAutomaticResponse")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentEnableApplicationLayerAutomaticResponseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpEnableProactiveEngagement struct {
}
func (*awsAwsjson11_serializeOpEnableProactiveEngagement) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpEnableProactiveEngagement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EnableProactiveEngagementInput)
_ = 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("AWSShield_20160616.EnableProactiveEngagement")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentEnableProactiveEngagementInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetSubscriptionState struct {
}
func (*awsAwsjson11_serializeOpGetSubscriptionState) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSubscriptionState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSubscriptionStateInput)
_ = 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("AWSShield_20160616.GetSubscriptionState")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSubscriptionStateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListAttacks struct {
}
func (*awsAwsjson11_serializeOpListAttacks) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAttacks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAttacksInput)
_ = 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("AWSShield_20160616.ListAttacks")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAttacksInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListProtectionGroups struct {
}
func (*awsAwsjson11_serializeOpListProtectionGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListProtectionGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListProtectionGroupsInput)
_ = 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("AWSShield_20160616.ListProtectionGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListProtectionGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListProtections struct {
}
func (*awsAwsjson11_serializeOpListProtections) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListProtections) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListProtectionsInput)
_ = 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("AWSShield_20160616.ListProtections")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListProtectionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpListResourcesInProtectionGroup struct {
}
func (*awsAwsjson11_serializeOpListResourcesInProtectionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListResourcesInProtectionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListResourcesInProtectionGroupInput)
_ = 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("AWSShield_20160616.ListResourcesInProtectionGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListResourcesInProtectionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSShield_20160616.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSShield_20160616.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSShield_20160616.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateApplicationLayerAutomaticResponse struct {
}
func (*awsAwsjson11_serializeOpUpdateApplicationLayerAutomaticResponse) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateApplicationLayerAutomaticResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateApplicationLayerAutomaticResponseInput)
_ = 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("AWSShield_20160616.UpdateApplicationLayerAutomaticResponse")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateApplicationLayerAutomaticResponseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateEmergencyContactSettings struct {
}
func (*awsAwsjson11_serializeOpUpdateEmergencyContactSettings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateEmergencyContactSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateEmergencyContactSettingsInput)
_ = 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("AWSShield_20160616.UpdateEmergencyContactSettings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateEmergencyContactSettingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateProtectionGroup struct {
}
func (*awsAwsjson11_serializeOpUpdateProtectionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateProtectionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateProtectionGroupInput)
_ = 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("AWSShield_20160616.UpdateProtectionGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateProtectionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateSubscription struct {
}
func (*awsAwsjson11_serializeOpUpdateSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSubscriptionInput)
_ = 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("AWSShield_20160616.UpdateSubscription")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeDocumentBlockAction(v *types.BlockAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentCountAction(v *types.CountAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentEmergencyContact(v *types.EmergencyContact, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContactNotes != nil {
ok := object.Key("ContactNotes")
ok.String(*v.ContactNotes)
}
if v.EmailAddress != nil {
ok := object.Key("EmailAddress")
ok.String(*v.EmailAddress)
}
if v.PhoneNumber != nil {
ok := object.Key("PhoneNumber")
ok.String(*v.PhoneNumber)
}
return nil
}
func awsAwsjson11_serializeDocumentEmergencyContactList(v []types.EmergencyContact, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentEmergencyContact(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInclusionProtectionFilters(v *types.InclusionProtectionFilters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProtectionNames != nil {
ok := object.Key("ProtectionNames")
if err := awsAwsjson11_serializeDocumentProtectionNameFilters(v.ProtectionNames, ok); err != nil {
return err
}
}
if v.ResourceArns != nil {
ok := object.Key("ResourceArns")
if err := awsAwsjson11_serializeDocumentResourceArnFilters(v.ResourceArns, ok); err != nil {
return err
}
}
if v.ResourceTypes != nil {
ok := object.Key("ResourceTypes")
if err := awsAwsjson11_serializeDocumentProtectedResourceTypeFilters(v.ResourceTypes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInclusionProtectionGroupFilters(v *types.InclusionProtectionGroupFilters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Aggregations != nil {
ok := object.Key("Aggregations")
if err := awsAwsjson11_serializeDocumentProtectionGroupAggregationFilters(v.Aggregations, ok); err != nil {
return err
}
}
if v.Patterns != nil {
ok := object.Key("Patterns")
if err := awsAwsjson11_serializeDocumentProtectionGroupPatternFilters(v.Patterns, ok); err != nil {
return err
}
}
if v.ProtectionGroupIds != nil {
ok := object.Key("ProtectionGroupIds")
if err := awsAwsjson11_serializeDocumentProtectionGroupIdFilters(v.ProtectionGroupIds, ok); err != nil {
return err
}
}
if v.ResourceTypes != nil {
ok := object.Key("ResourceTypes")
if err := awsAwsjson11_serializeDocumentProtectedResourceTypeFilters(v.ResourceTypes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProtectedResourceTypeFilters(v []types.ProtectedResourceType, 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_serializeDocumentProtectionGroupAggregationFilters(v []types.ProtectionGroupAggregation, 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_serializeDocumentProtectionGroupIdFilters(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_serializeDocumentProtectionGroupMembers(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_serializeDocumentProtectionGroupPatternFilters(v []types.ProtectionGroupPattern, 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_serializeDocumentProtectionNameFilters(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_serializeDocumentResourceArnFilterList(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_serializeDocumentResourceArnFilters(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_serializeDocumentResponseAction(v *types.ResponseAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Block != nil {
ok := object.Key("Block")
if err := awsAwsjson11_serializeDocumentBlockAction(v.Block, ok); err != nil {
return err
}
}
if v.Count != nil {
ok := object.Key("Count")
if err := awsAwsjson11_serializeDocumentCountAction(v.Count, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTimeRange(v *types.TimeRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FromInclusive != nil {
ok := object.Key("FromInclusive")
ok.Double(smithytime.FormatEpochSeconds(*v.FromInclusive))
}
if v.ToExclusive != nil {
ok := object.Key("ToExclusive")
ok.Double(smithytime.FormatEpochSeconds(*v.ToExclusive))
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateDRTLogBucketInput(v *AssociateDRTLogBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogBucket != nil {
ok := object.Key("LogBucket")
ok.String(*v.LogBucket)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateDRTRoleInput(v *AssociateDRTRoleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("RoleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateHealthCheckInput(v *AssociateHealthCheckInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HealthCheckArn != nil {
ok := object.Key("HealthCheckArn")
ok.String(*v.HealthCheckArn)
}
if v.ProtectionId != nil {
ok := object.Key("ProtectionId")
ok.String(*v.ProtectionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateProactiveEngagementDetailsInput(v *AssociateProactiveEngagementDetailsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EmergencyContactList != nil {
ok := object.Key("EmergencyContactList")
if err := awsAwsjson11_serializeDocumentEmergencyContactList(v.EmergencyContactList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateProtectionGroupInput(v *CreateProtectionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Aggregation) > 0 {
ok := object.Key("Aggregation")
ok.String(string(v.Aggregation))
}
if v.Members != nil {
ok := object.Key("Members")
if err := awsAwsjson11_serializeDocumentProtectionGroupMembers(v.Members, ok); err != nil {
return err
}
}
if len(v.Pattern) > 0 {
ok := object.Key("Pattern")
ok.String(string(v.Pattern))
}
if v.ProtectionGroupId != nil {
ok := object.Key("ProtectionGroupId")
ok.String(*v.ProtectionGroupId)
}
if len(v.ResourceType) > 0 {
ok := object.Key("ResourceType")
ok.String(string(v.ResourceType))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateProtectionInput(v *CreateProtectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSubscriptionInput(v *CreateSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteProtectionGroupInput(v *DeleteProtectionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProtectionGroupId != nil {
ok := object.Key("ProtectionGroupId")
ok.String(*v.ProtectionGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteProtectionInput(v *DeleteProtectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProtectionId != nil {
ok := object.Key("ProtectionId")
ok.String(*v.ProtectionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSubscriptionInput(v *DeleteSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAttackInput(v *DescribeAttackInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttackId != nil {
ok := object.Key("AttackId")
ok.String(*v.AttackId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAttackStatisticsInput(v *DescribeAttackStatisticsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeDRTAccessInput(v *DescribeDRTAccessInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeEmergencyContactSettingsInput(v *DescribeEmergencyContactSettingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeProtectionGroupInput(v *DescribeProtectionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProtectionGroupId != nil {
ok := object.Key("ProtectionGroupId")
ok.String(*v.ProtectionGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeProtectionInput(v *DescribeProtectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProtectionId != nil {
ok := object.Key("ProtectionId")
ok.String(*v.ProtectionId)
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSubscriptionInput(v *DescribeSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDisableApplicationLayerAutomaticResponseInput(v *DisableApplicationLayerAutomaticResponseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisableProactiveEngagementInput(v *DisableProactiveEngagementInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateDRTLogBucketInput(v *DisassociateDRTLogBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogBucket != nil {
ok := object.Key("LogBucket")
ok.String(*v.LogBucket)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateDRTRoleInput(v *DisassociateDRTRoleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateHealthCheckInput(v *DisassociateHealthCheckInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HealthCheckArn != nil {
ok := object.Key("HealthCheckArn")
ok.String(*v.HealthCheckArn)
}
if v.ProtectionId != nil {
ok := object.Key("ProtectionId")
ok.String(*v.ProtectionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentEnableApplicationLayerAutomaticResponseInput(v *EnableApplicationLayerAutomaticResponseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
if err := awsAwsjson11_serializeDocumentResponseAction(v.Action, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentEnableProactiveEngagementInput(v *EnableProactiveEngagementInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetSubscriptionStateInput(v *GetSubscriptionStateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentListAttacksInput(v *ListAttacksInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("EndTime")
if err := awsAwsjson11_serializeDocumentTimeRange(v.EndTime, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.ResourceArns != nil {
ok := object.Key("ResourceArns")
if err := awsAwsjson11_serializeDocumentResourceArnFilterList(v.ResourceArns, ok); err != nil {
return err
}
}
if v.StartTime != nil {
ok := object.Key("StartTime")
if err := awsAwsjson11_serializeDocumentTimeRange(v.StartTime, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListProtectionGroupsInput(v *ListProtectionGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InclusionFilters != nil {
ok := object.Key("InclusionFilters")
if err := awsAwsjson11_serializeDocumentInclusionProtectionGroupFilters(v.InclusionFilters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListProtectionsInput(v *ListProtectionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InclusionFilters != nil {
ok := object.Key("InclusionFilters")
if err := awsAwsjson11_serializeDocumentInclusionProtectionFilters(v.InclusionFilters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListResourcesInProtectionGroupInput(v *ListResourcesInProtectionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.ProtectionGroupId != nil {
ok := object.Key("ProtectionGroupId")
ok.String(*v.ProtectionGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateApplicationLayerAutomaticResponseInput(v *UpdateApplicationLayerAutomaticResponseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
if err := awsAwsjson11_serializeDocumentResponseAction(v.Action, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateEmergencyContactSettingsInput(v *UpdateEmergencyContactSettingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EmergencyContactList != nil {
ok := object.Key("EmergencyContactList")
if err := awsAwsjson11_serializeDocumentEmergencyContactList(v.EmergencyContactList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateProtectionGroupInput(v *UpdateProtectionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Aggregation) > 0 {
ok := object.Key("Aggregation")
ok.String(string(v.Aggregation))
}
if v.Members != nil {
ok := object.Key("Members")
if err := awsAwsjson11_serializeDocumentProtectionGroupMembers(v.Members, ok); err != nil {
return err
}
}
if len(v.Pattern) > 0 {
ok := object.Key("Pattern")
ok.String(string(v.Pattern))
}
if v.ProtectionGroupId != nil {
ok := object.Key("ProtectionGroupId")
ok.String(*v.ProtectionGroupId)
}
if len(v.ResourceType) > 0 {
ok := object.Key("ResourceType")
ok.String(string(v.ResourceType))
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSubscriptionInput(v *UpdateSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AutoRenew) > 0 {
ok := object.Key("AutoRenew")
ok.String(string(v.AutoRenew))
}
return nil
}
| 2,828 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package shield
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/shield/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateDRTLogBucket struct {
}
func (*validateOpAssociateDRTLogBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateDRTLogBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateDRTLogBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateDRTLogBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssociateDRTRole struct {
}
func (*validateOpAssociateDRTRole) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateDRTRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateDRTRoleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateDRTRoleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssociateHealthCheck struct {
}
func (*validateOpAssociateHealthCheck) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateHealthCheck) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateHealthCheckInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateHealthCheckInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssociateProactiveEngagementDetails struct {
}
func (*validateOpAssociateProactiveEngagementDetails) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateProactiveEngagementDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateProactiveEngagementDetailsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateProactiveEngagementDetailsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateProtectionGroup struct {
}
func (*validateOpCreateProtectionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateProtectionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateProtectionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateProtectionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateProtection struct {
}
func (*validateOpCreateProtection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateProtectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateProtectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProtectionGroup struct {
}
func (*validateOpDeleteProtectionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProtectionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProtectionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProtectionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProtection struct {
}
func (*validateOpDeleteProtection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProtectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProtectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAttack struct {
}
func (*validateOpDescribeAttack) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAttack) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAttackInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAttackInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeProtectionGroup struct {
}
func (*validateOpDescribeProtectionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeProtectionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeProtectionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeProtectionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisableApplicationLayerAutomaticResponse struct {
}
func (*validateOpDisableApplicationLayerAutomaticResponse) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisableApplicationLayerAutomaticResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisableApplicationLayerAutomaticResponseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisableApplicationLayerAutomaticResponseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateDRTLogBucket struct {
}
func (*validateOpDisassociateDRTLogBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateDRTLogBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateDRTLogBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateDRTLogBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateHealthCheck struct {
}
func (*validateOpDisassociateHealthCheck) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateHealthCheck) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateHealthCheckInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateHealthCheckInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpEnableApplicationLayerAutomaticResponse struct {
}
func (*validateOpEnableApplicationLayerAutomaticResponse) ID() string {
return "OperationInputValidation"
}
func (m *validateOpEnableApplicationLayerAutomaticResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*EnableApplicationLayerAutomaticResponseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpEnableApplicationLayerAutomaticResponseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListResourcesInProtectionGroup struct {
}
func (*validateOpListResourcesInProtectionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListResourcesInProtectionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListResourcesInProtectionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListResourcesInProtectionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateApplicationLayerAutomaticResponse struct {
}
func (*validateOpUpdateApplicationLayerAutomaticResponse) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateApplicationLayerAutomaticResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateApplicationLayerAutomaticResponseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateApplicationLayerAutomaticResponseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateEmergencyContactSettings struct {
}
func (*validateOpUpdateEmergencyContactSettings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateEmergencyContactSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateEmergencyContactSettingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateEmergencyContactSettingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateProtectionGroup struct {
}
func (*validateOpUpdateProtectionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateProtectionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateProtectionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateProtectionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateDRTLogBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateDRTLogBucket{}, middleware.After)
}
func addOpAssociateDRTRoleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateDRTRole{}, middleware.After)
}
func addOpAssociateHealthCheckValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateHealthCheck{}, middleware.After)
}
func addOpAssociateProactiveEngagementDetailsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateProactiveEngagementDetails{}, middleware.After)
}
func addOpCreateProtectionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateProtectionGroup{}, middleware.After)
}
func addOpCreateProtectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateProtection{}, middleware.After)
}
func addOpDeleteProtectionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProtectionGroup{}, middleware.After)
}
func addOpDeleteProtectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProtection{}, middleware.After)
}
func addOpDescribeAttackValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAttack{}, middleware.After)
}
func addOpDescribeProtectionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeProtectionGroup{}, middleware.After)
}
func addOpDisableApplicationLayerAutomaticResponseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisableApplicationLayerAutomaticResponse{}, middleware.After)
}
func addOpDisassociateDRTLogBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateDRTLogBucket{}, middleware.After)
}
func addOpDisassociateHealthCheckValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateHealthCheck{}, middleware.After)
}
func addOpEnableApplicationLayerAutomaticResponseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpEnableApplicationLayerAutomaticResponse{}, middleware.After)
}
func addOpListResourcesInProtectionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListResourcesInProtectionGroup{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateApplicationLayerAutomaticResponseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateApplicationLayerAutomaticResponse{}, middleware.After)
}
func addOpUpdateEmergencyContactSettingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateEmergencyContactSettings{}, middleware.After)
}
func addOpUpdateProtectionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateProtectionGroup{}, middleware.After)
}
func validateEmergencyContact(v *types.EmergencyContact) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EmergencyContact"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEmergencyContactList(v []types.EmergencyContact) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EmergencyContactList"}
for i := range v {
if err := validateEmergencyContact(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateDRTLogBucketInput(v *AssociateDRTLogBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateDRTLogBucketInput"}
if v.LogBucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogBucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateDRTRoleInput(v *AssociateDRTRoleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateDRTRoleInput"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateHealthCheckInput(v *AssociateHealthCheckInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateHealthCheckInput"}
if v.ProtectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionId"))
}
if v.HealthCheckArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("HealthCheckArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateProactiveEngagementDetailsInput(v *AssociateProactiveEngagementDetailsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateProactiveEngagementDetailsInput"}
if v.EmergencyContactList == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmergencyContactList"))
} else if v.EmergencyContactList != nil {
if err := validateEmergencyContactList(v.EmergencyContactList); err != nil {
invalidParams.AddNested("EmergencyContactList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateProtectionGroupInput(v *CreateProtectionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateProtectionGroupInput"}
if v.ProtectionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionGroupId"))
}
if len(v.Aggregation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Aggregation"))
}
if len(v.Pattern) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Pattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateProtectionInput(v *CreateProtectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateProtectionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProtectionGroupInput(v *DeleteProtectionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProtectionGroupInput"}
if v.ProtectionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProtectionInput(v *DeleteProtectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProtectionInput"}
if v.ProtectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAttackInput(v *DescribeAttackInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAttackInput"}
if v.AttackId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttackId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeProtectionGroupInput(v *DescribeProtectionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeProtectionGroupInput"}
if v.ProtectionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisableApplicationLayerAutomaticResponseInput(v *DisableApplicationLayerAutomaticResponseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisableApplicationLayerAutomaticResponseInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateDRTLogBucketInput(v *DisassociateDRTLogBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateDRTLogBucketInput"}
if v.LogBucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogBucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateHealthCheckInput(v *DisassociateHealthCheckInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateHealthCheckInput"}
if v.ProtectionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionId"))
}
if v.HealthCheckArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("HealthCheckArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpEnableApplicationLayerAutomaticResponseInput(v *EnableApplicationLayerAutomaticResponseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnableApplicationLayerAutomaticResponseInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListResourcesInProtectionGroupInput(v *ListResourcesInProtectionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListResourcesInProtectionGroupInput"}
if v.ProtectionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateApplicationLayerAutomaticResponseInput(v *UpdateApplicationLayerAutomaticResponseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationLayerAutomaticResponseInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateEmergencyContactSettingsInput(v *UpdateEmergencyContactSettingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateEmergencyContactSettingsInput"}
if v.EmergencyContactList != nil {
if err := validateEmergencyContactList(v.EmergencyContactList); err != nil {
invalidParams.AddNested("EmergencyContactList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateProtectionGroupInput(v *UpdateProtectionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateProtectionGroupInput"}
if v.ProtectionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProtectionGroupId"))
}
if len(v.Aggregation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Aggregation"))
}
if len(v.Pattern) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Pattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 902 |
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 Shield 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: "shield.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "shield-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "shield-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: false,
PartitionEndpoint: "aws-global",
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
Hostname: "shield.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "aws-global",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "shield-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "fips-aws-global",
}: endpoints.Endpoint{
Hostname: "shield-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "shield.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "shield-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "shield-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{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: "shield-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{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: "shield-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{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: "shield-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{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: "shield-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{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: "shield.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "shield-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "shield-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "shield.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 326 |
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 ApplicationLayerAutomaticResponseStatus string
// Enum values for ApplicationLayerAutomaticResponseStatus
const (
ApplicationLayerAutomaticResponseStatusEnabled ApplicationLayerAutomaticResponseStatus = "ENABLED"
ApplicationLayerAutomaticResponseStatusDisabled ApplicationLayerAutomaticResponseStatus = "DISABLED"
)
// Values returns all known values for ApplicationLayerAutomaticResponseStatus.
// 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 (ApplicationLayerAutomaticResponseStatus) Values() []ApplicationLayerAutomaticResponseStatus {
return []ApplicationLayerAutomaticResponseStatus{
"ENABLED",
"DISABLED",
}
}
type AttackLayer string
// Enum values for AttackLayer
const (
AttackLayerNetwork AttackLayer = "NETWORK"
AttackLayerApplication AttackLayer = "APPLICATION"
)
// Values returns all known values for AttackLayer. 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 (AttackLayer) Values() []AttackLayer {
return []AttackLayer{
"NETWORK",
"APPLICATION",
}
}
type AttackPropertyIdentifier string
// Enum values for AttackPropertyIdentifier
const (
AttackPropertyIdentifierDestinationUrl AttackPropertyIdentifier = "DESTINATION_URL"
AttackPropertyIdentifierReferrer AttackPropertyIdentifier = "REFERRER"
AttackPropertyIdentifierSourceAsn AttackPropertyIdentifier = "SOURCE_ASN"
AttackPropertyIdentifierSourceCountry AttackPropertyIdentifier = "SOURCE_COUNTRY"
AttackPropertyIdentifierSourceIpAddress AttackPropertyIdentifier = "SOURCE_IP_ADDRESS"
AttackPropertyIdentifierSourceUserAgent AttackPropertyIdentifier = "SOURCE_USER_AGENT"
AttackPropertyIdentifierWordpressPingbackReflector AttackPropertyIdentifier = "WORDPRESS_PINGBACK_REFLECTOR"
AttackPropertyIdentifierWordpressPingbackSource AttackPropertyIdentifier = "WORDPRESS_PINGBACK_SOURCE"
)
// Values returns all known values for AttackPropertyIdentifier. 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 (AttackPropertyIdentifier) Values() []AttackPropertyIdentifier {
return []AttackPropertyIdentifier{
"DESTINATION_URL",
"REFERRER",
"SOURCE_ASN",
"SOURCE_COUNTRY",
"SOURCE_IP_ADDRESS",
"SOURCE_USER_AGENT",
"WORDPRESS_PINGBACK_REFLECTOR",
"WORDPRESS_PINGBACK_SOURCE",
}
}
type AutoRenew string
// Enum values for AutoRenew
const (
AutoRenewEnabled AutoRenew = "ENABLED"
AutoRenewDisabled AutoRenew = "DISABLED"
)
// Values returns all known values for AutoRenew. 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 (AutoRenew) Values() []AutoRenew {
return []AutoRenew{
"ENABLED",
"DISABLED",
}
}
type ProactiveEngagementStatus string
// Enum values for ProactiveEngagementStatus
const (
ProactiveEngagementStatusEnabled ProactiveEngagementStatus = "ENABLED"
ProactiveEngagementStatusDisabled ProactiveEngagementStatus = "DISABLED"
ProactiveEngagementStatusPending ProactiveEngagementStatus = "PENDING"
)
// Values returns all known values for ProactiveEngagementStatus. 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 (ProactiveEngagementStatus) Values() []ProactiveEngagementStatus {
return []ProactiveEngagementStatus{
"ENABLED",
"DISABLED",
"PENDING",
}
}
type ProtectedResourceType string
// Enum values for ProtectedResourceType
const (
ProtectedResourceTypeCloudfrontDistribution ProtectedResourceType = "CLOUDFRONT_DISTRIBUTION"
ProtectedResourceTypeRoute53HostedZone ProtectedResourceType = "ROUTE_53_HOSTED_ZONE"
ProtectedResourceTypeElasticIpAllocation ProtectedResourceType = "ELASTIC_IP_ALLOCATION"
ProtectedResourceTypeClassicLoadBalancer ProtectedResourceType = "CLASSIC_LOAD_BALANCER"
ProtectedResourceTypeApplicationLoadBalancer ProtectedResourceType = "APPLICATION_LOAD_BALANCER"
ProtectedResourceTypeGlobalAccelerator ProtectedResourceType = "GLOBAL_ACCELERATOR"
)
// Values returns all known values for ProtectedResourceType. 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 (ProtectedResourceType) Values() []ProtectedResourceType {
return []ProtectedResourceType{
"CLOUDFRONT_DISTRIBUTION",
"ROUTE_53_HOSTED_ZONE",
"ELASTIC_IP_ALLOCATION",
"CLASSIC_LOAD_BALANCER",
"APPLICATION_LOAD_BALANCER",
"GLOBAL_ACCELERATOR",
}
}
type ProtectionGroupAggregation string
// Enum values for ProtectionGroupAggregation
const (
ProtectionGroupAggregationSum ProtectionGroupAggregation = "SUM"
ProtectionGroupAggregationMean ProtectionGroupAggregation = "MEAN"
ProtectionGroupAggregationMax ProtectionGroupAggregation = "MAX"
)
// Values returns all known values for ProtectionGroupAggregation. 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 (ProtectionGroupAggregation) Values() []ProtectionGroupAggregation {
return []ProtectionGroupAggregation{
"SUM",
"MEAN",
"MAX",
}
}
type ProtectionGroupPattern string
// Enum values for ProtectionGroupPattern
const (
ProtectionGroupPatternAll ProtectionGroupPattern = "ALL"
ProtectionGroupPatternArbitrary ProtectionGroupPattern = "ARBITRARY"
ProtectionGroupPatternByResourceType ProtectionGroupPattern = "BY_RESOURCE_TYPE"
)
// Values returns all known values for ProtectionGroupPattern. 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 (ProtectionGroupPattern) Values() []ProtectionGroupPattern {
return []ProtectionGroupPattern{
"ALL",
"ARBITRARY",
"BY_RESOURCE_TYPE",
}
}
type SubResourceType string
// Enum values for SubResourceType
const (
SubResourceTypeIp SubResourceType = "IP"
SubResourceTypeUrl SubResourceType = "URL"
)
// Values returns all known values for SubResourceType. 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 (SubResourceType) Values() []SubResourceType {
return []SubResourceType{
"IP",
"URL",
}
}
type SubscriptionState string
// Enum values for SubscriptionState
const (
SubscriptionStateActive SubscriptionState = "ACTIVE"
SubscriptionStateInactive SubscriptionState = "INACTIVE"
)
// Values returns all known values for SubscriptionState. 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 (SubscriptionState) Values() []SubscriptionState {
return []SubscriptionState{
"ACTIVE",
"INACTIVE",
}
}
type Unit string
// Enum values for Unit
const (
UnitBits Unit = "BITS"
UnitBytes Unit = "BYTES"
UnitPackets Unit = "PACKETS"
UnitRequests Unit = "REQUESTS"
)
// Values returns all known values for Unit. Note that this can be expanded in the
// future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Unit) Values() []Unit {
return []Unit{
"BITS",
"BYTES",
"PACKETS",
"REQUESTS",
}
}
type ValidationExceptionReason string
// Enum values for ValidationExceptionReason
const (
ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FIELD_VALIDATION_FAILED"
ValidationExceptionReasonOther ValidationExceptionReason = "OTHER"
)
// Values returns all known values for ValidationExceptionReason. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ValidationExceptionReason) Values() []ValidationExceptionReason {
return []ValidationExceptionReason{
"FIELD_VALIDATION_FAILED",
"OTHER",
}
}
| 251 |
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"
)
// Exception that indicates the specified AttackId does not exist, or the
// requester does not have the appropriate permissions to access the AttackId .
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// In order to grant the necessary access to the Shield Response Team (SRT) the
// user submitting the request must have the iam:PassRole permission. This error
// indicates the user did not have the appropriate permissions. For more
// information, see Granting a User Permissions to Pass a Role to an Amazon Web
// Services Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)
// .
type AccessDeniedForDependencyException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedForDependencyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedForDependencyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedForDependencyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedForDependencyException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedForDependencyException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// Exception that indicates that a problem occurred with the service
// infrastructure. You can retry the request.
type InternalErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalErrorException"
}
return *e.ErrorCodeOverride
}
func (e *InternalErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Exception that indicates that the operation would not cause any change to occur.
type InvalidOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidOperationException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception that indicates that the NextToken specified in the request is
// invalid. Submit the request using the NextToken value that was returned in the
// prior response.
type InvalidPaginationTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidPaginationTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidPaginationTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidPaginationTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidPaginationTokenException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidPaginationTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception that indicates that the parameters passed to the API are invalid. If
// available, this exception includes details in additional properties.
type InvalidParameterException struct {
Message *string
ErrorCodeOverride *string
Reason ValidationExceptionReason
Fields []ValidationExceptionField
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 }
// Exception that indicates that the resource is invalid. You might not have
// access to the resource, or the resource might not exist.
type InvalidResourceException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidResourceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidResourceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidResourceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidResourceException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidResourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception that indicates that the operation would exceed a limit.
type LimitsExceededException struct {
Message *string
ErrorCodeOverride *string
Type *string
Limit int64
noSmithyDocumentSerde
}
func (e *LimitsExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitsExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitsExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitsExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitsExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You are trying to update a subscription that has not yet completed the 1-year
// commitment. You can change the AutoRenew parameter during the last 30 days of
// your subscription. This exception indicates that you are attempting to change
// AutoRenew prior to that period.
type LockedSubscriptionException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LockedSubscriptionException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LockedSubscriptionException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LockedSubscriptionException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LockedSubscriptionException"
}
return *e.ErrorCodeOverride
}
func (e *LockedSubscriptionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The ARN of the role that you specified does not exist.
type NoAssociatedRoleException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NoAssociatedRoleException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NoAssociatedRoleException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NoAssociatedRoleException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NoAssociatedRoleException"
}
return *e.ErrorCodeOverride
}
func (e *NoAssociatedRoleException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception that indicates that the resource state has been modified by another
// client. Retrieve the resource and then retry your request.
type OptimisticLockException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *OptimisticLockException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *OptimisticLockException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *OptimisticLockException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "OptimisticLockException"
}
return *e.ErrorCodeOverride
}
func (e *OptimisticLockException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception indicating the specified resource already exists. If available, this
// exception includes details in additional properties.
type ResourceAlreadyExistsException struct {
Message *string
ErrorCodeOverride *string
ResourceType *string
noSmithyDocumentSerde
}
func (e *ResourceAlreadyExistsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceAlreadyExistsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceAlreadyExistsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceAlreadyExistsException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception indicating the specified resource does not exist. If available, this
// exception includes details in additional properties.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
ResourceType *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 376 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// The automatic application layer DDoS mitigation settings for a Protection . This
// configuration determines whether Shield Advanced automatically manages rules in
// the web ACL in order to respond to application layer events that Shield Advanced
// determines to be DDoS attacks.
type ApplicationLayerAutomaticResponseConfiguration struct {
// Specifies the action setting that Shield Advanced should use in the WAF rules
// that it creates on behalf of the protected resource in response to DDoS attacks.
// You specify this as part of the configuration for the automatic application
// layer DDoS mitigation feature, when you enable or update automatic mitigation.
// Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group,
// inside the web ACL that you have associated with the resource.
//
// This member is required.
Action *ResponseAction
// Indicates whether automatic application layer DDoS mitigation is enabled for
// the protection.
//
// This member is required.
Status ApplicationLayerAutomaticResponseStatus
noSmithyDocumentSerde
}
// The details of a DDoS attack.
type AttackDetail struct {
// List of counters that describe the attack for the specified time period.
AttackCounters []SummarizedCounter
// The unique identifier (ID) of the attack.
AttackId *string
// The array of objects that provide details of the Shield event. For
// infrastructure layer events (L3 and L4 events), you can view metrics for top
// contributors in Amazon CloudWatch metrics. For more information, see Shield
// metrics and alarms (https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html#set-ddos-alarms)
// in the WAF Developer Guide.
AttackProperties []AttackProperty
// The time the attack ended, in Unix time in seconds.
EndTime *time.Time
// List of mitigation actions taken for the attack.
Mitigations []Mitigation
// The ARN (Amazon Resource Name) of the resource that was attacked.
ResourceArn *string
// The time the attack started, in Unix time in seconds.
StartTime *time.Time
// If applicable, additional detail about the resource being attacked, for
// example, IP address or URL.
SubResources []SubResourceSummary
noSmithyDocumentSerde
}
// Details of a Shield event. This is provided as part of an AttackDetail .
type AttackProperty struct {
// The type of Shield event that was observed. NETWORK indicates layer 3 and layer
// 4 events and APPLICATION indicates layer 7 events. For infrastructure layer
// events (L3 and L4 events), you can view metrics for top contributors in Amazon
// CloudWatch metrics. For more information, see Shield metrics and alarms (https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html#set-ddos-alarms)
// in the WAF Developer Guide.
AttackLayer AttackLayer
// Defines the Shield event property information that is provided. The
// WORDPRESS_PINGBACK_REFLECTOR and WORDPRESS_PINGBACK_SOURCE values are valid
// only for WordPress reflective pingback events.
AttackPropertyIdentifier AttackPropertyIdentifier
// Contributor objects for the top five contributors to a Shield event. A
// contributor is a source of traffic that Shield Advanced identifies as
// responsible for some or all of an event.
TopContributors []Contributor
// The total contributions made to this Shield event by all contributors.
Total int64
// The unit used for the Contributor Value property.
Unit Unit
noSmithyDocumentSerde
}
// A single attack statistics data record. This is returned by
// DescribeAttackStatistics along with a time range indicating the time period that
// the attack statistics apply to.
type AttackStatisticsDataItem struct {
// The number of attacks detected during the time period. This is always present,
// but might be zero.
//
// This member is required.
AttackCount int64
// Information about the volume of attacks during the time period. If the
// accompanying AttackCount is zero, this setting might be empty.
AttackVolume *AttackVolume
noSmithyDocumentSerde
}
// Summarizes all DDoS attacks for a specified time period.
type AttackSummary struct {
// The unique identifier (ID) of the attack.
AttackId *string
// The list of attacks for a specified time period.
AttackVectors []AttackVectorDescription
// The end time of the attack, in Unix time in seconds.
EndTime *time.Time
// The ARN (Amazon Resource Name) of the resource that was attacked.
ResourceArn *string
// The start time of the attack, in Unix time in seconds.
StartTime *time.Time
noSmithyDocumentSerde
}
// Describes the attack.
type AttackVectorDescription struct {
// The attack type. Valid values:
// - UDP_TRAFFIC
// - UDP_FRAGMENT
// - GENERIC_UDP_REFLECTION
// - DNS_REFLECTION
// - NTP_REFLECTION
// - CHARGEN_REFLECTION
// - SSDP_REFLECTION
// - PORT_MAPPER
// - RIP_REFLECTION
// - SNMP_REFLECTION
// - MSSQL_REFLECTION
// - NET_BIOS_REFLECTION
// - SYN_FLOOD
// - ACK_FLOOD
// - REQUEST_FLOOD
// - HTTP_REFLECTION
// - UDS_REFLECTION
// - MEMCACHED_REFLECTION
//
// This member is required.
VectorType *string
noSmithyDocumentSerde
}
// Information about the volume of attacks during the time period, included in an
// AttackStatisticsDataItem . If the accompanying AttackCount in the statistics
// object is zero, this setting might be empty.
type AttackVolume struct {
// A statistics object that uses bits per second as the unit. This is included for
// network level attacks.
BitsPerSecond *AttackVolumeStatistics
// A statistics object that uses packets per second as the unit. This is included
// for network level attacks.
PacketsPerSecond *AttackVolumeStatistics
// A statistics object that uses requests per second as the unit. This is included
// for application level attacks, and is only available for accounts that are
// subscribed to Shield Advanced.
RequestsPerSecond *AttackVolumeStatistics
noSmithyDocumentSerde
}
// Statistics objects for the various data types in AttackVolume .
type AttackVolumeStatistics struct {
// The maximum attack volume observed for the given unit.
//
// This member is required.
Max float64
noSmithyDocumentSerde
}
// Specifies that Shield Advanced should configure its WAF rules with the WAF Block
// action. This is only used in the context of the ResponseAction setting. JSON
// specification: "Block": {}
type BlockAction struct {
noSmithyDocumentSerde
}
// A contributor to the attack and their contribution.
type Contributor struct {
// The name of the contributor. The type of name that you'll find here depends on
// the AttackPropertyIdentifier setting in the AttackProperty where this
// contributor is defined. For example, if the AttackPropertyIdentifier is
// SOURCE_COUNTRY , the Name could be United States .
Name *string
// The contribution of this contributor expressed in Protection units. For example
// 10,000 .
Value int64
noSmithyDocumentSerde
}
// Specifies that Shield Advanced should configure its WAF rules with the WAF Count
// action. This is only used in the context of the ResponseAction setting. JSON
// specification: "Count": {}
type CountAction struct {
noSmithyDocumentSerde
}
// Contact information that the SRT can use to contact you if you have proactive
// engagement enabled, for escalations to the SRT and to initiate proactive
// customer support.
type EmergencyContact struct {
// The email address for the contact.
//
// This member is required.
EmailAddress *string
// Additional notes regarding the contact.
ContactNotes *string
// The phone number for the contact.
PhoneNumber *string
noSmithyDocumentSerde
}
// Narrows the set of protections that the call retrieves. You can retrieve a
// single protection by providing its name or the ARN (Amazon Resource Name) of its
// protected resource. You can also retrieve all protections for a specific
// resource type. You can provide up to one criteria per filter type. Shield
// Advanced returns protections that exactly match all of the filter criteria that
// you provide.
type InclusionProtectionFilters struct {
// The name of the protection that you want to retrieve.
ProtectionNames []string
// The ARN (Amazon Resource Name) of the resource whose protection you want to
// retrieve.
ResourceArns []string
// The type of protected resource whose protections you want to retrieve.
ResourceTypes []ProtectedResourceType
noSmithyDocumentSerde
}
// Narrows the set of protection groups that the call retrieves. You can retrieve
// a single protection group by its name and you can retrieve all protection groups
// that are configured with a specific pattern, aggregation, or resource type. You
// can provide up to one criteria per filter type. Shield Advanced returns the
// protection groups that exactly match all of the search criteria that you
// provide.
type InclusionProtectionGroupFilters struct {
// The aggregation setting of the protection groups that you want to retrieve.
Aggregations []ProtectionGroupAggregation
// The pattern specification of the protection groups that you want to retrieve.
Patterns []ProtectionGroupPattern
// The ID of the protection group that you want to retrieve.
ProtectionGroupIds []string
// The resource type configuration of the protection groups that you want to
// retrieve. In the protection group configuration, you specify the resource type
// when you set the group's Pattern to BY_RESOURCE_TYPE .
ResourceTypes []ProtectedResourceType
noSmithyDocumentSerde
}
// Specifies how many protections of a given type you can create.
type Limit struct {
// The maximum number of protections that can be created for the specified Type .
Max int64
// The type of protection.
Type *string
noSmithyDocumentSerde
}
// The mitigation applied to a DDoS attack.
type Mitigation struct {
// The name of the mitigation taken for this attack.
MitigationName *string
noSmithyDocumentSerde
}
// An object that represents a resource that is under DDoS protection.
type Protection struct {
// The automatic application layer DDoS mitigation settings for the protection.
// This configuration determines whether Shield Advanced automatically manages
// rules in the web ACL in order to respond to application layer events that Shield
// Advanced determines to be DDoS attacks.
ApplicationLayerAutomaticResponseConfiguration *ApplicationLayerAutomaticResponseConfiguration
// The unique identifier (ID) for the Route 53 health check that's associated with
// the protection.
HealthCheckIds []string
// The unique identifier (ID) of the protection.
Id *string
// The name of the protection. For example, My CloudFront distributions .
Name *string
// The ARN (Amazon Resource Name) of the protection.
ProtectionArn *string
// The ARN (Amazon Resource Name) of the Amazon Web Services resource that is
// protected.
ResourceArn *string
noSmithyDocumentSerde
}
// A grouping of protected resources that you and Shield Advanced can monitor as a
// collective. This resource grouping improves the accuracy of detection and
// reduces false positives.
type ProtectionGroup struct {
// Defines how Shield combines resource data for the group in order to detect,
// mitigate, and report events.
// - Sum - Use the total traffic across the group. This is a good choice for
// most cases. Examples include Elastic IP addresses for EC2 instances that scale
// manually or automatically.
// - Mean - Use the average of the traffic across the group. This is a good
// choice for resources that share traffic uniformly. Examples include accelerators
// and load balancers.
// - Max - Use the highest traffic from each resource. This is useful for
// resources that don't share traffic and for resources that share that traffic in
// a non-uniform way. Examples include Amazon CloudFront distributions and origin
// resources for CloudFront distributions.
//
// This member is required.
Aggregation ProtectionGroupAggregation
// The ARNs (Amazon Resource Names) of the resources to include in the protection
// group. You must set this when you set Pattern to ARBITRARY and you must not set
// it for any other Pattern setting.
//
// This member is required.
Members []string
// The criteria to use to choose the protected resources for inclusion in the
// group. You can include all resources that have protections, provide a list of
// resource ARNs (Amazon Resource Names), or include all resources of a specified
// resource type.
//
// This member is required.
Pattern ProtectionGroupPattern
// The name of the protection group. You use this to identify the protection group
// in lists and to manage the protection group, for example to update, delete, or
// describe it.
//
// This member is required.
ProtectionGroupId *string
// The ARN (Amazon Resource Name) of the protection group.
ProtectionGroupArn *string
// The resource type to include in the protection group. All protected resources
// of this type are included in the protection group. You must set this when you
// set Pattern to BY_RESOURCE_TYPE and you must not set it for any other Pattern
// setting.
ResourceType ProtectedResourceType
noSmithyDocumentSerde
}
// Limits settings on protection groups with arbitrary pattern type.
type ProtectionGroupArbitraryPatternLimits struct {
// The maximum number of resources you can specify for a single arbitrary pattern
// in a protection group.
//
// This member is required.
MaxMembers int64
noSmithyDocumentSerde
}
// Limits settings on protection groups for your subscription.
type ProtectionGroupLimits struct {
// The maximum number of protection groups that you can have at one time.
//
// This member is required.
MaxProtectionGroups int64
// Limits settings by pattern type in the protection groups for your subscription.
//
// This member is required.
PatternTypeLimits *ProtectionGroupPatternTypeLimits
noSmithyDocumentSerde
}
// Limits settings by pattern type in the protection groups for your subscription.
type ProtectionGroupPatternTypeLimits struct {
// Limits settings on protection groups with arbitrary pattern type.
//
// This member is required.
ArbitraryPatternLimits *ProtectionGroupArbitraryPatternLimits
noSmithyDocumentSerde
}
// Limits settings on protections for your subscription.
type ProtectionLimits struct {
// The maximum number of resource types that you can specify in a protection.
//
// This member is required.
ProtectedResourceTypeLimits []Limit
noSmithyDocumentSerde
}
// Specifies the action setting that Shield Advanced should use in the WAF rules
// that it creates on behalf of the protected resource in response to DDoS attacks.
// You specify this as part of the configuration for the automatic application
// layer DDoS mitigation feature, when you enable or update automatic mitigation.
// Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group,
// inside the web ACL that you have associated with the resource.
type ResponseAction struct {
// Specifies that Shield Advanced should configure its WAF rules with the WAF Block
// action. You must specify exactly one action, either Block or Count .
Block *BlockAction
// Specifies that Shield Advanced should configure its WAF rules with the WAF Count
// action. You must specify exactly one action, either Block or Count .
Count *CountAction
noSmithyDocumentSerde
}
// The attack information for the specified SubResource.
type SubResourceSummary struct {
// The list of attack types and associated counters.
AttackVectors []SummarizedAttackVector
// The counters that describe the details of the attack.
Counters []SummarizedCounter
// The unique identifier (ID) of the SubResource .
Id *string
// The SubResource type.
Type SubResourceType
noSmithyDocumentSerde
}
// Information about the Shield Advanced subscription for an account.
type Subscription struct {
// Limits settings for your subscription.
//
// This member is required.
SubscriptionLimits *SubscriptionLimits
// If ENABLED , the subscription will be automatically renewed at the end of the
// existing subscription period. When you initally create a subscription, AutoRenew
// is set to ENABLED . You can change this by submitting an UpdateSubscription
// request. If the UpdateSubscription request does not included a value for
// AutoRenew , the existing value for AutoRenew remains unchanged.
AutoRenew AutoRenew
// The date and time your subscription will end.
EndTime *time.Time
// Specifies how many protections of a given type you can create.
Limits []Limit
// If ENABLED , the Shield Response Team (SRT) will use email and phone to notify
// contacts about escalations to the SRT and to initiate proactive customer
// support. If PENDING , you have requested proactive engagement and the request is
// pending. The status changes to ENABLED when your request is fully processed. If
// DISABLED , the SRT will not proactively notify contacts about escalations or to
// initiate proactive customer support.
ProactiveEngagementStatus ProactiveEngagementStatus
// The start time of the subscription, in Unix time in seconds.
StartTime *time.Time
// The ARN (Amazon Resource Name) of the subscription.
SubscriptionArn *string
// The length, in seconds, of the Shield Advanced subscription for the account.
TimeCommitmentInSeconds int64
noSmithyDocumentSerde
}
// Limits settings for your subscription.
type SubscriptionLimits struct {
// Limits settings on protection groups for your subscription.
//
// This member is required.
ProtectionGroupLimits *ProtectionGroupLimits
// Limits settings on protections for your subscription.
//
// This member is required.
ProtectionLimits *ProtectionLimits
noSmithyDocumentSerde
}
// A summary of information about the attack.
type SummarizedAttackVector struct {
// The attack type, for example, SNMP reflection or SYN flood.
//
// This member is required.
VectorType *string
// The list of counters that describe the details of the attack.
VectorCounters []SummarizedCounter
noSmithyDocumentSerde
}
// The counter that describes a DDoS attack.
type SummarizedCounter struct {
// The average value of the counter for a specified time period.
Average float64
// The maximum value of the counter for a specified time period.
Max float64
// The number of counters for a specified time period.
N int32
// The counter name.
Name *string
// The total of counter values for a specified time period.
Sum float64
// The unit of the counters.
Unit *string
noSmithyDocumentSerde
}
// A tag associated with an Amazon Web Services resource. Tags are key:value pairs
// that you can use to categorize and manage your resources, for purposes like
// billing or other management. Typically, the tag key represents a category, such
// as "environment", and the tag value represents a specific value within that
// category, such as "test," "development," or "production". Or you might set the
// tag key to "customer" and the value to the customer name or ID. You can specify
// one or more tags to add to each Amazon Web Services resource, up to 50 tags for
// a resource.
type Tag struct {
// Part of the key:value pair that defines a tag. You can use a tag key to
// describe a category of information, such as "customer." Tag keys are
// case-sensitive.
Key *string
// Part of the key:value pair that defines a tag. You can use a tag value to
// describe a specific value within a category, such as "companyA" or "companyB."
// Tag values are case-sensitive.
Value *string
noSmithyDocumentSerde
}
// The time range.
type TimeRange struct {
// The start time, in Unix time in seconds.
FromInclusive *time.Time
// The end time, in Unix time in seconds.
ToExclusive *time.Time
noSmithyDocumentSerde
}
// Provides information about a particular parameter passed inside a request that
// resulted in an exception.
type ValidationExceptionField struct {
// The message describing why the parameter failed validation.
//
// This member is required.
Message *string
// The name of the parameter that failed validation.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 634 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "signer"
const ServiceAPIVersion = "2017-08-25"
// Client provides the API client to make operations call for AWS Signer.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "signer", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 454 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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 signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds cross-account permissions to a signing profile.
func (c *Client) AddProfilePermission(ctx context.Context, params *AddProfilePermissionInput, optFns ...func(*Options)) (*AddProfilePermissionOutput, error) {
if params == nil {
params = &AddProfilePermissionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddProfilePermission", params, optFns, c.addOperationAddProfilePermissionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddProfilePermissionOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddProfilePermissionInput struct {
// The AWS Signer action permitted as part of cross-account permissions.
//
// This member is required.
Action *string
// The AWS principal receiving cross-account permissions. This may be an IAM role
// or another AWS account ID.
//
// This member is required.
Principal *string
// The human-readable name of the signing profile.
//
// This member is required.
ProfileName *string
// A unique identifier for the cross-account permission statement.
//
// This member is required.
StatementId *string
// The version of the signing profile.
ProfileVersion *string
// A unique identifier for the current profile revision.
RevisionId *string
noSmithyDocumentSerde
}
type AddProfilePermissionOutput struct {
// A unique identifier for the current profile revision.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddProfilePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAddProfilePermission{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAddProfilePermission{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddProfilePermissionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddProfilePermission(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddProfilePermission(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "AddProfilePermission",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Changes the state of an ACTIVE signing profile to CANCELED . A canceled profile
// is still viewable with the ListSigningProfiles operation, but it cannot perform
// new signing jobs, and is deleted two years after cancelation.
func (c *Client) CancelSigningProfile(ctx context.Context, params *CancelSigningProfileInput, optFns ...func(*Options)) (*CancelSigningProfileOutput, error) {
if params == nil {
params = &CancelSigningProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelSigningProfile", params, optFns, c.addOperationCancelSigningProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelSigningProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type CancelSigningProfileInput struct {
// The name of the signing profile to be canceled.
//
// This member is required.
ProfileName *string
noSmithyDocumentSerde
}
type CancelSigningProfileOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelSigningProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelSigningProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelSigningProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelSigningProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSigningProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCancelSigningProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "CancelSigningProfile",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
"errors"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/signer/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Returns information about a specific code signing job. You specify the job by
// using the jobId value that is returned by the StartSigningJob operation.
func (c *Client) DescribeSigningJob(ctx context.Context, params *DescribeSigningJobInput, optFns ...func(*Options)) (*DescribeSigningJobOutput, error) {
if params == nil {
params = &DescribeSigningJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSigningJob", params, optFns, c.addOperationDescribeSigningJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSigningJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSigningJobInput struct {
// The ID of the signing job on input.
//
// This member is required.
JobId *string
noSmithyDocumentSerde
}
type DescribeSigningJobOutput struct {
// Date and time that the signing job was completed.
CompletedAt *time.Time
// Date and time that the signing job was created.
CreatedAt *time.Time
// The ID of the signing job on output.
JobId *string
// The IAM entity that initiated the signing job.
JobInvoker *string
// The AWS account ID of the job owner.
JobOwner *string
// A list of any overrides that were applied to the signing operation.
Overrides *types.SigningPlatformOverrides
// A human-readable name for the signing platform associated with the signing job.
PlatformDisplayName *string
// The microcontroller platform to which your signed code image will be
// distributed.
PlatformId *string
// The name of the profile that initiated the signing operation.
ProfileName *string
// The version of the signing profile used to initiate the signing job.
ProfileVersion *string
// The IAM principal that requested the signing job.
RequestedBy *string
// A revocation record if the signature generated by the signing job has been
// revoked. Contains a timestamp and the ID of the IAM entity that revoked the
// signature.
RevocationRecord *types.SigningJobRevocationRecord
// Thr expiration timestamp for the signature generated by the signing job.
SignatureExpiresAt *time.Time
// Name of the S3 bucket where the signed code image is saved by code signing.
SignedObject *types.SignedObject
// The Amazon Resource Name (ARN) of your code signing certificate.
SigningMaterial *types.SigningMaterial
// Map of user-assigned key-value pairs used during signing. These values contain
// any information that you specified for use in your signing job.
SigningParameters map[string]string
// The object that contains the name of your S3 bucket or your raw code.
Source *types.Source
// Status of the signing job.
Status types.SigningStatus
// String value that contains the status reason.
StatusReason *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSigningJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSigningJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSigningJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSigningJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSigningJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeSigningJobAPIClient is a client that implements the DescribeSigningJob
// operation.
type DescribeSigningJobAPIClient interface {
DescribeSigningJob(context.Context, *DescribeSigningJobInput, ...func(*Options)) (*DescribeSigningJobOutput, error)
}
var _ DescribeSigningJobAPIClient = (*Client)(nil)
// SuccessfulSigningJobWaiterOptions are waiter options for
// SuccessfulSigningJobWaiter
type SuccessfulSigningJobWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// SuccessfulSigningJobWaiter will use default minimum delay of 20 seconds. Note
// that MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, SuccessfulSigningJobWaiter will use default max delay of 120
// seconds. Note that MaxDelay must resolve to value greater than or equal to the
// MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeSigningJobInput, *DescribeSigningJobOutput, error) (bool, error)
}
// SuccessfulSigningJobWaiter defines the waiters for SuccessfulSigningJob
type SuccessfulSigningJobWaiter struct {
client DescribeSigningJobAPIClient
options SuccessfulSigningJobWaiterOptions
}
// NewSuccessfulSigningJobWaiter constructs a SuccessfulSigningJobWaiter.
func NewSuccessfulSigningJobWaiter(client DescribeSigningJobAPIClient, optFns ...func(*SuccessfulSigningJobWaiterOptions)) *SuccessfulSigningJobWaiter {
options := SuccessfulSigningJobWaiterOptions{}
options.MinDelay = 20 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = successfulSigningJobStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &SuccessfulSigningJobWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for SuccessfulSigningJob waiter. The maxWaitDur
// is the maximum wait duration the waiter will wait. The maxWaitDur is required
// and must be greater than zero.
func (w *SuccessfulSigningJobWaiter) Wait(ctx context.Context, params *DescribeSigningJobInput, maxWaitDur time.Duration, optFns ...func(*SuccessfulSigningJobWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for SuccessfulSigningJob waiter and
// returns the output of the successful operation. The maxWaitDur is the maximum
// wait duration the waiter will wait. The maxWaitDur is required and must be
// greater than zero.
func (w *SuccessfulSigningJobWaiter) WaitForOutput(ctx context.Context, params *DescribeSigningJobInput, maxWaitDur time.Duration, optFns ...func(*SuccessfulSigningJobWaiterOptions)) (*DescribeSigningJobOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeSigningJob(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for SuccessfulSigningJob waiter")
}
func successfulSigningJobStateRetryable(ctx context.Context, input *DescribeSigningJobInput, output *DescribeSigningJobOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("status", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Succeeded"
value, ok := pathValue.(types.SigningStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.SigningStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("status", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "Failed"
value, ok := pathValue.(types.SigningStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.SigningStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err != nil {
var errorType *types.ResourceNotFoundException
if errors.As(err, &errorType) {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeSigningJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "DescribeSigningJob",
}
}
| 384 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the revocation status of one or more of the signing profile, signing
// job, and signing certificate.
func (c *Client) GetRevocationStatus(ctx context.Context, params *GetRevocationStatusInput, optFns ...func(*Options)) (*GetRevocationStatusOutput, error) {
if params == nil {
params = &GetRevocationStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetRevocationStatus", params, optFns, c.addOperationGetRevocationStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetRevocationStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetRevocationStatusInput struct {
// A list of composite signed hashes that identify certificates. A certificate
// identifier consists of a subject certificate TBS hash (signed by the parent CA)
// combined with a parent CA TBS hash (signed by the parent CA’s CA). Root
// certificates are defined as their own CA.
//
// This member is required.
CertificateHashes []string
// The ARN of a signing job.
//
// This member is required.
JobArn *string
// The ID of a signing platform.
//
// This member is required.
PlatformId *string
// The version of a signing profile.
//
// This member is required.
ProfileVersionArn *string
// The timestamp of the signature that validates the profile or job.
//
// This member is required.
SignatureTimestamp *time.Time
noSmithyDocumentSerde
}
type GetRevocationStatusOutput struct {
// A list of revoked entities (including one or more of the signing profile ARN,
// signing job ID, and certificate hash) supplied as input to the API.
RevokedEntities []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetRevocationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRevocationStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRevocationStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetRevocationStatusMiddleware(stack); err != nil {
return err
}
if err = addOpGetRevocationStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRevocationStatus(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetRevocationStatusMiddleware struct {
}
func (*endpointPrefix_opGetRevocationStatusMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetRevocationStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "verification." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetRevocationStatusMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetRevocationStatusMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetRevocationStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "GetRevocationStatus",
}
}
| 181 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information on a specific signing platform.
func (c *Client) GetSigningPlatform(ctx context.Context, params *GetSigningPlatformInput, optFns ...func(*Options)) (*GetSigningPlatformOutput, error) {
if params == nil {
params = &GetSigningPlatformInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSigningPlatform", params, optFns, c.addOperationGetSigningPlatformMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSigningPlatformOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSigningPlatformInput struct {
// The ID of the target signing platform.
//
// This member is required.
PlatformId *string
noSmithyDocumentSerde
}
type GetSigningPlatformOutput struct {
// The category type of the target signing platform.
Category types.Category
// The display name of the target signing platform.
DisplayName *string
// The maximum size (in MB) of the payload that can be signed by the target
// platform.
MaxSizeInMB int32
// A list of partner entities that use the target signing platform.
Partner *string
// The ID of the target signing platform.
PlatformId *string
// A flag indicating whether signatures generated for the signing platform can be
// revoked.
RevocationSupported bool
// A list of configurations applied to the target platform at signing.
SigningConfiguration *types.SigningConfiguration
// The format of the target platform's signing image.
SigningImageFormat *types.SigningImageFormat
// The validation template that is used by the target signing platform.
Target *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSigningPlatformMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSigningPlatform{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSigningPlatform{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSigningPlatformValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSigningPlatform(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetSigningPlatform(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "GetSigningPlatform",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information on a specific signing profile.
func (c *Client) GetSigningProfile(ctx context.Context, params *GetSigningProfileInput, optFns ...func(*Options)) (*GetSigningProfileOutput, error) {
if params == nil {
params = &GetSigningProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSigningProfile", params, optFns, c.addOperationGetSigningProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSigningProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSigningProfileInput struct {
// The name of the target signing profile.
//
// This member is required.
ProfileName *string
// The AWS account ID of the profile owner.
ProfileOwner *string
noSmithyDocumentSerde
}
type GetSigningProfileOutput struct {
// The Amazon Resource Name (ARN) for the signing profile.
Arn *string
// A list of overrides applied by the target signing profile for signing
// operations.
Overrides *types.SigningPlatformOverrides
// A human-readable name for the signing platform associated with the signing
// profile.
PlatformDisplayName *string
// The ID of the platform that is used by the target signing profile.
PlatformId *string
// The name of the target signing profile.
ProfileName *string
// The current version of the signing profile.
ProfileVersion *string
// The signing profile ARN, including the profile version.
ProfileVersionArn *string
// Revocation information for a signing profile.
RevocationRecord *types.SigningProfileRevocationRecord
// The validity period for a signing job.
SignatureValidityPeriod *types.SignatureValidityPeriod
// The ARN of the certificate that the target profile uses for signing operations.
SigningMaterial *types.SigningMaterial
// A map of key-value pairs for signing operations that is attached to the target
// signing profile.
SigningParameters map[string]string
// The status of the target signing profile.
Status types.SigningProfileStatus
// Reason for the status of the target signing profile.
StatusReason *string
// A list of tags associated with the signing profile.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSigningProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSigningProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSigningProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSigningProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSigningProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetSigningProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "GetSigningProfile",
}
}
| 170 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the cross-account permissions associated with a signing profile.
func (c *Client) ListProfilePermissions(ctx context.Context, params *ListProfilePermissionsInput, optFns ...func(*Options)) (*ListProfilePermissionsOutput, error) {
if params == nil {
params = &ListProfilePermissionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProfilePermissions", params, optFns, c.addOperationListProfilePermissionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProfilePermissionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProfilePermissionsInput struct {
// Name of the signing profile containing the cross-account permissions.
//
// This member is required.
ProfileName *string
// String for specifying the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListProfilePermissionsOutput struct {
// String for specifying the next set of paginated results.
NextToken *string
// List of permissions associated with the Signing Profile.
Permissions []types.Permission
// Total size of the policy associated with the Signing Profile in bytes.
PolicySizeBytes int32
// The identifier for the current revision of profile permissions.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProfilePermissionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfilePermissions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfilePermissions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListProfilePermissionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProfilePermissions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListProfilePermissions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "ListProfilePermissions",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists all your signing jobs. You can use the maxResults parameter to limit the
// number of signing jobs that are returned in the response. If additional jobs
// remain to be listed, code signing returns a nextToken value. Use this value in
// subsequent calls to ListSigningJobs to fetch the remaining values. You can
// continue calling ListSigningJobs with your maxResults parameter and with new
// values that code signing returns in the nextToken parameter until all of your
// signing jobs have been returned.
func (c *Client) ListSigningJobs(ctx context.Context, params *ListSigningJobsInput, optFns ...func(*Options)) (*ListSigningJobsOutput, error) {
if params == nil {
params = &ListSigningJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSigningJobs", params, optFns, c.addOperationListSigningJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSigningJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSigningJobsInput struct {
// Filters results to return only signing jobs with revoked signatures.
IsRevoked bool
// Filters results to return only signing jobs initiated by a specified IAM entity.
JobInvoker *string
// Specifies the maximum number of items to return in the response. Use this
// parameter when paginating results. If additional items exist beyond the number
// you specify, the nextToken element is set in the response. Use the nextToken
// value in a subsequent request to retrieve additional items.
MaxResults *int32
// String for specifying the next set of paginated results to return. After you
// receive a response with truncated results, use this parameter in a subsequent
// request. Set it to the value of nextToken from the response that you just
// received.
NextToken *string
// The ID of microcontroller platform that you specified for the distribution of
// your code image.
PlatformId *string
// The IAM principal that requested the signing job.
RequestedBy *string
// Filters results to return only signing jobs with signatures expiring after a
// specified timestamp.
SignatureExpiresAfter *time.Time
// Filters results to return only signing jobs with signatures expiring before a
// specified timestamp.
SignatureExpiresBefore *time.Time
// A status value with which to filter your results.
Status types.SigningStatus
noSmithyDocumentSerde
}
type ListSigningJobsOutput struct {
// A list of your signing jobs.
Jobs []types.SigningJob
// String for specifying the next set of paginated results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSigningJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSigningJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSigningJobs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSigningJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSigningJobsAPIClient is a client that implements the ListSigningJobs
// operation.
type ListSigningJobsAPIClient interface {
ListSigningJobs(context.Context, *ListSigningJobsInput, ...func(*Options)) (*ListSigningJobsOutput, error)
}
var _ ListSigningJobsAPIClient = (*Client)(nil)
// ListSigningJobsPaginatorOptions is the paginator options for ListSigningJobs
type ListSigningJobsPaginatorOptions struct {
// Specifies the maximum number of items to return in the response. Use this
// parameter when paginating results. If additional items exist beyond the number
// you specify, the nextToken element is set in the response. Use the nextToken
// value in a subsequent request to retrieve additional items.
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
}
// ListSigningJobsPaginator is a paginator for ListSigningJobs
type ListSigningJobsPaginator struct {
options ListSigningJobsPaginatorOptions
client ListSigningJobsAPIClient
params *ListSigningJobsInput
nextToken *string
firstPage bool
}
// NewListSigningJobsPaginator returns a new ListSigningJobsPaginator
func NewListSigningJobsPaginator(client ListSigningJobsAPIClient, params *ListSigningJobsInput, optFns ...func(*ListSigningJobsPaginatorOptions)) *ListSigningJobsPaginator {
if params == nil {
params = &ListSigningJobsInput{}
}
options := ListSigningJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSigningJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSigningJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSigningJobs page.
func (p *ListSigningJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningJobsOutput, 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.ListSigningJobs(ctx, ¶ms, 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_opListSigningJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "ListSigningJobs",
}
}
| 257 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all signing platforms available in code signing that match the request
// parameters. If additional jobs remain to be listed, code signing returns a
// nextToken value. Use this value in subsequent calls to ListSigningJobs to fetch
// the remaining values. You can continue calling ListSigningJobs with your
// maxResults parameter and with new values that code signing returns in the
// nextToken parameter until all of your signing jobs have been returned.
func (c *Client) ListSigningPlatforms(ctx context.Context, params *ListSigningPlatformsInput, optFns ...func(*Options)) (*ListSigningPlatformsOutput, error) {
if params == nil {
params = &ListSigningPlatformsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSigningPlatforms", params, optFns, c.addOperationListSigningPlatformsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSigningPlatformsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSigningPlatformsInput struct {
// The category type of a signing platform.
Category *string
// The maximum number of results to be returned by this operation.
MaxResults *int32
// Value for specifying the next set of paginated results to return. After you
// receive a response with truncated results, use this parameter in a subsequent
// request. Set it to the value of nextToken from the response that you just
// received.
NextToken *string
// Any partner entities connected to a signing platform.
Partner *string
// The validation template that is used by the target signing platform.
Target *string
noSmithyDocumentSerde
}
type ListSigningPlatformsOutput struct {
// Value for specifying the next set of paginated results to return.
NextToken *string
// A list of all platforms that match the request parameters.
Platforms []types.SigningPlatform
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSigningPlatformsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSigningPlatforms{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSigningPlatforms{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSigningPlatforms(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSigningPlatformsAPIClient is a client that implements the
// ListSigningPlatforms operation.
type ListSigningPlatformsAPIClient interface {
ListSigningPlatforms(context.Context, *ListSigningPlatformsInput, ...func(*Options)) (*ListSigningPlatformsOutput, error)
}
var _ ListSigningPlatformsAPIClient = (*Client)(nil)
// ListSigningPlatformsPaginatorOptions is the paginator options for
// ListSigningPlatforms
type ListSigningPlatformsPaginatorOptions struct {
// The maximum number of results to be returned by this operation.
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
}
// ListSigningPlatformsPaginator is a paginator for ListSigningPlatforms
type ListSigningPlatformsPaginator struct {
options ListSigningPlatformsPaginatorOptions
client ListSigningPlatformsAPIClient
params *ListSigningPlatformsInput
nextToken *string
firstPage bool
}
// NewListSigningPlatformsPaginator returns a new ListSigningPlatformsPaginator
func NewListSigningPlatformsPaginator(client ListSigningPlatformsAPIClient, params *ListSigningPlatformsInput, optFns ...func(*ListSigningPlatformsPaginatorOptions)) *ListSigningPlatformsPaginator {
if params == nil {
params = &ListSigningPlatformsInput{}
}
options := ListSigningPlatformsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSigningPlatformsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSigningPlatformsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSigningPlatforms page.
func (p *ListSigningPlatformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningPlatformsOutput, 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.ListSigningPlatforms(ctx, ¶ms, 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_opListSigningPlatforms(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "ListSigningPlatforms",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all available signing profiles in your AWS account. Returns only profiles
// with an ACTIVE status unless the includeCanceled request field is set to true .
// If additional jobs remain to be listed, code signing returns a nextToken value.
// Use this value in subsequent calls to ListSigningJobs to fetch the remaining
// values. You can continue calling ListSigningJobs with your maxResults parameter
// and with new values that code signing returns in the nextToken parameter until
// all of your signing jobs have been returned.
func (c *Client) ListSigningProfiles(ctx context.Context, params *ListSigningProfilesInput, optFns ...func(*Options)) (*ListSigningProfilesOutput, error) {
if params == nil {
params = &ListSigningProfilesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSigningProfiles", params, optFns, c.addOperationListSigningProfilesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSigningProfilesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSigningProfilesInput struct {
// Designates whether to include profiles with the status of CANCELED .
IncludeCanceled bool
// The maximum number of profiles to be returned.
MaxResults *int32
// Value for specifying the next set of paginated results to return. After you
// receive a response with truncated results, use this parameter in a subsequent
// request. Set it to the value of nextToken from the response that you just
// received.
NextToken *string
// Filters results to return only signing jobs initiated for a specified signing
// platform.
PlatformId *string
// Filters results to return only signing jobs with statuses in the specified list.
Statuses []types.SigningProfileStatus
noSmithyDocumentSerde
}
type ListSigningProfilesOutput struct {
// Value for specifying the next set of paginated results to return.
NextToken *string
// A list of profiles that are available in the AWS account. This includes
// profiles with the status of CANCELED if the includeCanceled parameter is set to
// true .
Profiles []types.SigningProfile
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSigningProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSigningProfiles{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSigningProfiles{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSigningProfiles(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSigningProfilesAPIClient is a client that implements the
// ListSigningProfiles operation.
type ListSigningProfilesAPIClient interface {
ListSigningProfiles(context.Context, *ListSigningProfilesInput, ...func(*Options)) (*ListSigningProfilesOutput, error)
}
var _ ListSigningProfilesAPIClient = (*Client)(nil)
// ListSigningProfilesPaginatorOptions is the paginator options for
// ListSigningProfiles
type ListSigningProfilesPaginatorOptions struct {
// The maximum number of profiles to be returned.
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
}
// ListSigningProfilesPaginator is a paginator for ListSigningProfiles
type ListSigningProfilesPaginator struct {
options ListSigningProfilesPaginatorOptions
client ListSigningProfilesAPIClient
params *ListSigningProfilesInput
nextToken *string
firstPage bool
}
// NewListSigningProfilesPaginator returns a new ListSigningProfilesPaginator
func NewListSigningProfilesPaginator(client ListSigningProfilesAPIClient, params *ListSigningProfilesInput, optFns ...func(*ListSigningProfilesPaginatorOptions)) *ListSigningProfilesPaginator {
if params == nil {
params = &ListSigningProfilesInput{}
}
options := ListSigningProfilesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSigningProfilesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSigningProfilesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSigningProfiles page.
func (p *ListSigningProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningProfilesOutput, 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.ListSigningProfiles(ctx, ¶ms, 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_opListSigningProfiles(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "ListSigningProfiles",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of the tags associated with a signing profile resource.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) for the signing profile.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// A list of tags associated with the signing profile.
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: "signer",
OperationName: "ListTagsForResource",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a signing profile. A signing profile is a code signing template that
// can be used to carry out a pre-defined signing job.
func (c *Client) PutSigningProfile(ctx context.Context, params *PutSigningProfileInput, optFns ...func(*Options)) (*PutSigningProfileOutput, error) {
if params == nil {
params = &PutSigningProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutSigningProfile", params, optFns, c.addOperationPutSigningProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutSigningProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutSigningProfileInput struct {
// The ID of the signing platform to be created.
//
// This member is required.
PlatformId *string
// The name of the signing profile to be created.
//
// This member is required.
ProfileName *string
// A subfield of platform . This specifies any different configuration options that
// you want to apply to the chosen platform (such as a different hash-algorithm or
// signing-algorithm ).
Overrides *types.SigningPlatformOverrides
// The default validity period override for any signature generated using this
// signing profile. If unspecified, the default is 135 months.
SignatureValidityPeriod *types.SignatureValidityPeriod
// The AWS Certificate Manager certificate that will be used to sign code with the
// new signing profile.
SigningMaterial *types.SigningMaterial
// Map of key-value pairs for signing. These can include any information that you
// want to use during signing.
SigningParameters map[string]string
// Tags to be associated with the signing profile that is being created.
Tags map[string]string
noSmithyDocumentSerde
}
type PutSigningProfileOutput struct {
// The Amazon Resource Name (ARN) of the signing profile created.
Arn *string
// The version of the signing profile being created.
ProfileVersion *string
// The signing profile ARN, including the profile version.
ProfileVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutSigningProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSigningProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSigningProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutSigningProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSigningProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutSigningProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "PutSigningProfile",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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 cross-account permissions from a signing profile.
func (c *Client) RemoveProfilePermission(ctx context.Context, params *RemoveProfilePermissionInput, optFns ...func(*Options)) (*RemoveProfilePermissionOutput, error) {
if params == nil {
params = &RemoveProfilePermissionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveProfilePermission", params, optFns, c.addOperationRemoveProfilePermissionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveProfilePermissionOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveProfilePermissionInput struct {
// A human-readable name for the signing profile with permissions to be removed.
//
// This member is required.
ProfileName *string
// An identifier for the current revision of the signing profile permissions.
//
// This member is required.
RevisionId *string
// A unique identifier for the cross-account permissions statement.
//
// This member is required.
StatementId *string
noSmithyDocumentSerde
}
type RemoveProfilePermissionOutput struct {
// An identifier for the current revision of the profile permissions.
RevisionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveProfilePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveProfilePermission{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveProfilePermission{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveProfilePermissionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveProfilePermission(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveProfilePermission(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "RemoveProfilePermission",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Changes the state of a signing job to REVOKED. This indicates that the
// signature is no longer valid.
func (c *Client) RevokeSignature(ctx context.Context, params *RevokeSignatureInput, optFns ...func(*Options)) (*RevokeSignatureOutput, error) {
if params == nil {
params = &RevokeSignatureInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RevokeSignature", params, optFns, c.addOperationRevokeSignatureMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RevokeSignatureOutput)
out.ResultMetadata = metadata
return out, nil
}
type RevokeSignatureInput struct {
// ID of the signing job to be revoked.
//
// This member is required.
JobId *string
// The reason for revoking the signing job.
//
// This member is required.
Reason *string
// AWS account ID of the job owner.
JobOwner *string
noSmithyDocumentSerde
}
type RevokeSignatureOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRevokeSignatureMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeSignature{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeSignature{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRevokeSignatureValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeSignature(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRevokeSignature(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "RevokeSignature",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Changes the state of a signing profile to REVOKED. This indicates that
// signatures generated using the signing profile after an effective start date are
// no longer valid.
func (c *Client) RevokeSigningProfile(ctx context.Context, params *RevokeSigningProfileInput, optFns ...func(*Options)) (*RevokeSigningProfileOutput, error) {
if params == nil {
params = &RevokeSigningProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RevokeSigningProfile", params, optFns, c.addOperationRevokeSigningProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RevokeSigningProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type RevokeSigningProfileInput struct {
// A timestamp for when revocation of a Signing Profile should become effective.
// Signatures generated using the signing profile after this timestamp are not
// trusted.
//
// This member is required.
EffectiveTime *time.Time
// The name of the signing profile to be revoked.
//
// This member is required.
ProfileName *string
// The version of the signing profile to be revoked.
//
// This member is required.
ProfileVersion *string
// The reason for revoking a signing profile.
//
// This member is required.
Reason *string
noSmithyDocumentSerde
}
type RevokeSigningProfileOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRevokeSigningProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeSigningProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeSigningProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRevokeSigningProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeSigningProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRevokeSigningProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "RevokeSigningProfile",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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"
)
// Signs a binary payload and returns a signature envelope.
func (c *Client) SignPayload(ctx context.Context, params *SignPayloadInput, optFns ...func(*Options)) (*SignPayloadOutput, error) {
if params == nil {
params = &SignPayloadInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SignPayload", params, optFns, c.addOperationSignPayloadMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SignPayloadOutput)
out.ResultMetadata = metadata
return out, nil
}
type SignPayloadInput struct {
// Specifies the object digest (hash) to sign.
//
// This member is required.
Payload []byte
// Payload content type
//
// This member is required.
PayloadFormat *string
// The name of the signing profile.
//
// This member is required.
ProfileName *string
// The AWS account ID of the profile owner.
ProfileOwner *string
noSmithyDocumentSerde
}
type SignPayloadOutput struct {
// Unique identifier of the signing job.
JobId *string
// The AWS account ID of the job owner.
JobOwner *string
// Information including the signing profile ARN and the signing job ID. Clients
// use metadata to signature records, for example, as annotations added to the
// signature manifest inside an OCI registry.
Metadata map[string]string
// A cryptographic signature.
Signature []byte
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSignPayloadMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSignPayload{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSignPayload{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSignPayloadValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSignPayload(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSignPayload(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "SignPayload",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Initiates a signing job to be performed on the code provided. Signing jobs are
// viewable by the ListSigningJobs operation for two years after they are
// performed. Note the following requirements:
// - You must create an Amazon S3 source bucket. For more information, see
// Creating a Bucket (http://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html)
// in the Amazon S3 Getting Started Guide.
// - Your S3 source bucket must be version enabled.
// - You must create an S3 destination bucket. Code signing uses your S3
// destination bucket to write your signed code.
// - You specify the name of the source and destination buckets when calling the
// StartSigningJob operation.
// - You must also specify a request token that identifies your request to code
// signing.
//
// You can call the DescribeSigningJob and the ListSigningJobs actions after you
// call StartSigningJob . For a Java example that shows how to use this action, see
// StartSigningJob (https://docs.aws.amazon.com/signer/latest/developerguide/api-startsigningjob.html)
// .
func (c *Client) StartSigningJob(ctx context.Context, params *StartSigningJobInput, optFns ...func(*Options)) (*StartSigningJobOutput, error) {
if params == nil {
params = &StartSigningJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartSigningJob", params, optFns, c.addOperationStartSigningJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartSigningJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartSigningJobInput struct {
// String that identifies the signing request. All calls after the first that use
// this token return the same response as the first call.
//
// This member is required.
ClientRequestToken *string
// The S3 bucket in which to save your signed object. The destination contains the
// name of your bucket and an optional prefix.
//
// This member is required.
Destination *types.Destination
// The name of the signing profile.
//
// This member is required.
ProfileName *string
// The S3 bucket that contains the object to sign or a BLOB that contains your raw
// code.
//
// This member is required.
Source *types.Source
// The AWS account ID of the signing profile owner.
ProfileOwner *string
noSmithyDocumentSerde
}
type StartSigningJobOutput struct {
// The ID of your signing job.
JobId *string
// The AWS account ID of the signing job owner.
JobOwner *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartSigningJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSigningJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSigningJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opStartSigningJobMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartSigningJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSigningJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpStartSigningJob struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartSigningJob) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartSigningJob) 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.(*StartSigningJobInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartSigningJobInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opStartSigningJobMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartSigningJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartSigningJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "signer",
OperationName: "StartSigningJob",
}
}
| 203 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds one or more tags to a signing profile. Tags are labels that you can use to
// identify and organize your AWS resources. Each tag consists of a key and an
// optional value. To specify the signing profile, use its Amazon Resource Name
// (ARN). To specify the tag, use a key-value pair.
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 signing profile.
//
// This member is required.
ResourceArn *string
// One or more tags to be associated with the signing profile.
//
// 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: "signer",
OperationName: "TagResource",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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 a signing profile. To remove the tags, specify a
// list of tag keys.
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 signing profile.
//
// This member is required.
ResourceArn *string
// A list of tag keys to be removed from the signing profile.
//
// 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: "signer",
OperationName: "UntagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/signer/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 awsRestjson1_deserializeOpAddProfilePermission struct {
}
func (*awsRestjson1_deserializeOpAddProfilePermission) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpAddProfilePermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAddProfilePermission(response, &metadata)
}
output := &AddProfilePermissionOutput{}
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_deserializeOpDocumentAddProfilePermissionOutput(&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_deserializeOpErrorAddProfilePermission(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceLimitExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentAddProfilePermissionOutput(v **AddProfilePermissionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddProfilePermissionOutput
if *v == nil {
sv = &AddProfilePermissionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCancelSigningProfile struct {
}
func (*awsRestjson1_deserializeOpCancelSigningProfile) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCancelSigningProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCancelSigningProfile(response, &metadata)
}
output := &CancelSigningProfileOutput{}
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 awsRestjson1_deserializeOpErrorCancelSigningProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDescribeSigningJob struct {
}
func (*awsRestjson1_deserializeOpDescribeSigningJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeSigningJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeSigningJob(response, &metadata)
}
output := &DescribeSigningJobOutput{}
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_deserializeOpDocumentDescribeSigningJobOutput(&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_deserializeOpErrorDescribeSigningJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeSigningJobOutput(v **DescribeSigningJobOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeSigningJobOutput
if *v == nil {
sv = &DescribeSigningJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "completedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "jobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "jobInvoker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobInvoker = ptr.String(jtv)
}
case "jobOwner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobOwner = ptr.String(jtv)
}
case "overrides":
if err := awsRestjson1_deserializeDocumentSigningPlatformOverrides(&sv.Overrides, value); err != nil {
return err
}
case "platformDisplayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.PlatformDisplayName = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlatformId to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "profileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value)
}
sv.ProfileName = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "requestedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RequestedBy to be of type string, got %T instead", value)
}
sv.RequestedBy = ptr.String(jtv)
}
case "revocationRecord":
if err := awsRestjson1_deserializeDocumentSigningJobRevocationRecord(&sv.RevocationRecord, value); err != nil {
return err
}
case "signatureExpiresAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SignatureExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "signedObject":
if err := awsRestjson1_deserializeDocumentSignedObject(&sv.SignedObject, value); err != nil {
return err
}
case "signingMaterial":
if err := awsRestjson1_deserializeDocumentSigningMaterial(&sv.SigningMaterial, value); err != nil {
return err
}
case "signingParameters":
if err := awsRestjson1_deserializeDocumentSigningParameters(&sv.SigningParameters, value); err != nil {
return err
}
case "source":
if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SigningStatus to be of type string, got %T instead", value)
}
sv.Status = types.SigningStatus(jtv)
}
case "statusReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value)
}
sv.StatusReason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetRevocationStatus struct {
}
func (*awsRestjson1_deserializeOpGetRevocationStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetRevocationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetRevocationStatus(response, &metadata)
}
output := &GetRevocationStatusOutput{}
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_deserializeOpDocumentGetRevocationStatusOutput(&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_deserializeOpErrorGetRevocationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetRevocationStatusOutput(v **GetRevocationStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRevocationStatusOutput
if *v == nil {
sv = &GetRevocationStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "revokedEntities":
if err := awsRestjson1_deserializeDocumentRevokedEntities(&sv.RevokedEntities, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSigningPlatform struct {
}
func (*awsRestjson1_deserializeOpGetSigningPlatform) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSigningPlatform) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetSigningPlatform(response, &metadata)
}
output := &GetSigningPlatformOutput{}
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_deserializeOpDocumentGetSigningPlatformOutput(&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_deserializeOpErrorGetSigningPlatform(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSigningPlatformOutput(v **GetSigningPlatformOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSigningPlatformOutput
if *v == nil {
sv = &GetSigningPlatformOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Category to be of type string, got %T instead", value)
}
sv.Category = types.Category(jtv)
}
case "displayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.DisplayName = ptr.String(jtv)
}
case "maxSizeInMB":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxSizeInMB to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxSizeInMB = int32(i64)
}
case "partner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Partner = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlatformId to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "revocationSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected bool to be of type *bool, got %T instead", value)
}
sv.RevocationSupported = jtv
}
case "signingConfiguration":
if err := awsRestjson1_deserializeDocumentSigningConfiguration(&sv.SigningConfiguration, value); err != nil {
return err
}
case "signingImageFormat":
if err := awsRestjson1_deserializeDocumentSigningImageFormat(&sv.SigningImageFormat, value); err != nil {
return err
}
case "target":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Target = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSigningProfile struct {
}
func (*awsRestjson1_deserializeOpGetSigningProfile) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSigningProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetSigningProfile(response, &metadata)
}
output := &GetSigningProfileOutput{}
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_deserializeOpDocumentGetSigningProfileOutput(&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_deserializeOpErrorGetSigningProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSigningProfileOutput(v **GetSigningProfileOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSigningProfileOutput
if *v == nil {
sv = &GetSigningProfileOutput{}
} 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 String to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "overrides":
if err := awsRestjson1_deserializeDocumentSigningPlatformOverrides(&sv.Overrides, value); err != nil {
return err
}
case "platformDisplayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.PlatformDisplayName = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlatformId to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "profileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value)
}
sv.ProfileName = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "profileVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ProfileVersionArn = ptr.String(jtv)
}
case "revocationRecord":
if err := awsRestjson1_deserializeDocumentSigningProfileRevocationRecord(&sv.RevocationRecord, value); err != nil {
return err
}
case "signatureValidityPeriod":
if err := awsRestjson1_deserializeDocumentSignatureValidityPeriod(&sv.SignatureValidityPeriod, value); err != nil {
return err
}
case "signingMaterial":
if err := awsRestjson1_deserializeDocumentSigningMaterial(&sv.SigningMaterial, value); err != nil {
return err
}
case "signingParameters":
if err := awsRestjson1_deserializeDocumentSigningParameters(&sv.SigningParameters, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SigningProfileStatus to be of type string, got %T instead", value)
}
sv.Status = types.SigningProfileStatus(jtv)
}
case "statusReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.StatusReason = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListProfilePermissions struct {
}
func (*awsRestjson1_deserializeOpListProfilePermissions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListProfilePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListProfilePermissions(response, &metadata)
}
output := &ListProfilePermissionsOutput{}
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_deserializeOpDocumentListProfilePermissionsOutput(&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_deserializeOpErrorListProfilePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListProfilePermissionsOutput(v **ListProfilePermissionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListProfilePermissionsOutput
if *v == nil {
sv = &ListProfilePermissionsOutput{}
} 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 String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "permissions":
if err := awsRestjson1_deserializeDocumentPermissions(&sv.Permissions, value); err != nil {
return err
}
case "policySizeBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PolicySizeBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.PolicySizeBytes = int32(i64)
}
case "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSigningJobs struct {
}
func (*awsRestjson1_deserializeOpListSigningJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSigningJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListSigningJobs(response, &metadata)
}
output := &ListSigningJobsOutput{}
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_deserializeOpDocumentListSigningJobsOutput(&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_deserializeOpErrorListSigningJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSigningJobsOutput(v **ListSigningJobsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSigningJobsOutput
if *v == nil {
sv = &ListSigningJobsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobs":
if err := awsRestjson1_deserializeDocumentSigningJobs(&sv.Jobs, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSigningPlatforms struct {
}
func (*awsRestjson1_deserializeOpListSigningPlatforms) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSigningPlatforms) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListSigningPlatforms(response, &metadata)
}
output := &ListSigningPlatformsOutput{}
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_deserializeOpDocumentListSigningPlatformsOutput(&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_deserializeOpErrorListSigningPlatforms(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSigningPlatformsOutput(v **ListSigningPlatformsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSigningPlatformsOutput
if *v == nil {
sv = &ListSigningPlatformsOutput{}
} 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 String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "platforms":
if err := awsRestjson1_deserializeDocumentSigningPlatforms(&sv.Platforms, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSigningProfiles struct {
}
func (*awsRestjson1_deserializeOpListSigningProfiles) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSigningProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListSigningProfiles(response, &metadata)
}
output := &ListSigningProfilesOutput{}
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_deserializeOpDocumentListSigningProfilesOutput(&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_deserializeOpErrorListSigningProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSigningProfilesOutput(v **ListSigningProfilesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSigningProfilesOutput
if *v == nil {
sv = &ListSigningProfilesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "profiles":
if err := awsRestjson1_deserializeDocumentSigningProfiles(&sv.Profiles, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(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_deserializeOpPutSigningProfile struct {
}
func (*awsRestjson1_deserializeOpPutSigningProfile) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutSigningProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutSigningProfile(response, &metadata)
}
output := &PutSigningProfileOutput{}
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_deserializeOpDocumentPutSigningProfileOutput(&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_deserializeOpErrorPutSigningProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutSigningProfileOutput(v **PutSigningProfileOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutSigningProfileOutput
if *v == nil {
sv = &PutSigningProfileOutput{}
} 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 String to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "profileVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ProfileVersionArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRemoveProfilePermission struct {
}
func (*awsRestjson1_deserializeOpRemoveProfilePermission) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRemoveProfilePermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorRemoveProfilePermission(response, &metadata)
}
output := &RemoveProfilePermissionOutput{}
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_deserializeOpDocumentRemoveProfilePermissionOutput(&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_deserializeOpErrorRemoveProfilePermission(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentRemoveProfilePermissionOutput(v **RemoveProfilePermissionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveProfilePermissionOutput
if *v == nil {
sv = &RemoveProfilePermissionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "revisionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RevisionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRevokeSignature struct {
}
func (*awsRestjson1_deserializeOpRevokeSignature) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRevokeSignature) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorRevokeSignature(response, &metadata)
}
output := &RevokeSignatureOutput{}
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 awsRestjson1_deserializeOpErrorRevokeSignature(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpRevokeSigningProfile struct {
}
func (*awsRestjson1_deserializeOpRevokeSigningProfile) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRevokeSigningProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorRevokeSigningProfile(response, &metadata)
}
output := &RevokeSigningProfileOutput{}
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 awsRestjson1_deserializeOpErrorRevokeSigningProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpSignPayload struct {
}
func (*awsRestjson1_deserializeOpSignPayload) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSignPayload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSignPayload(response, &metadata)
}
output := &SignPayloadOutput{}
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_deserializeOpDocumentSignPayloadOutput(&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_deserializeOpErrorSignPayload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSignPayloadOutput(v **SignPayloadOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SignPayloadOutput
if *v == nil {
sv = &SignPayloadOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "jobOwner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobOwner = ptr.String(jtv)
}
case "metadata":
if err := awsRestjson1_deserializeDocumentMetadata(&sv.Metadata, value); err != nil {
return err
}
case "signature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Blob to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode Blob, %w", err)
}
sv.Signature = dv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartSigningJob struct {
}
func (*awsRestjson1_deserializeOpStartSigningJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartSigningJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStartSigningJob(response, &metadata)
}
output := &StartSigningJobOutput{}
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_deserializeOpDocumentStartSigningJobOutput(&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_deserializeOpErrorStartSigningJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartSigningJobOutput(v **StartSigningJobOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartSigningJobOutput
if *v == nil {
sv = &StartSigningJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "jobOwner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobOwner = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(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("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(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_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_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_deserializeErrorInternalServiceErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServiceErrorException{}
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_deserializeDocumentInternalServiceErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, 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_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_deserializeErrorServiceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ServiceLimitExceededException{}
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_deserializeDocumentServiceLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_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_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 ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
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 "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEncryptionAlgorithmOptions(v **types.EncryptionAlgorithmOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EncryptionAlgorithmOptions
if *v == nil {
sv = &types.EncryptionAlgorithmOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "allowedValues":
if err := awsRestjson1_deserializeDocumentEncryptionAlgorithms(&sv.AllowedValues, value); err != nil {
return err
}
case "defaultValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionAlgorithm to be of type string, got %T instead", value)
}
sv.DefaultValue = types.EncryptionAlgorithm(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEncryptionAlgorithms(v *[]types.EncryptionAlgorithm, 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.EncryptionAlgorithm
if *v == nil {
cv = []types.EncryptionAlgorithm{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EncryptionAlgorithm
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionAlgorithm to be of type string, got %T instead", value)
}
col = types.EncryptionAlgorithm(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentHashAlgorithmOptions(v **types.HashAlgorithmOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HashAlgorithmOptions
if *v == nil {
sv = &types.HashAlgorithmOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "allowedValues":
if err := awsRestjson1_deserializeDocumentHashAlgorithms(&sv.AllowedValues, value); err != nil {
return err
}
case "defaultValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HashAlgorithm to be of type string, got %T instead", value)
}
sv.DefaultValue = types.HashAlgorithm(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentHashAlgorithms(v *[]types.HashAlgorithm, 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.HashAlgorithm
if *v == nil {
cv = []types.HashAlgorithm{}
} else {
cv = *v
}
for _, value := range shape {
var col types.HashAlgorithm
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HashAlgorithm to be of type string, got %T instead", value)
}
col = types.HashAlgorithm(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImageFormats(v *[]types.ImageFormat, 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.ImageFormat
if *v == nil {
cv = []types.ImageFormat{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImageFormat
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageFormat to be of type string, got %T instead", value)
}
col = types.ImageFormat(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInternalServiceErrorException(v **types.InternalServiceErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServiceErrorException
if *v == nil {
sv = &types.InternalServiceErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMetadata(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 String to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
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 "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPermission(v **types.Permission, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Permission
if *v == nil {
sv = &types.Permission{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "action":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Action = ptr.String(jtv)
}
case "principal":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Principal = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "statementId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.StatementId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPermissions(v *[]types.Permission, 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.Permission
if *v == nil {
cv = []types.Permission{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Permission
destAddr := &col
if err := awsRestjson1_deserializeDocumentPermission(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
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 "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRevokedEntities(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_deserializeDocumentS3SignedObject(v **types.S3SignedObject, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3SignedObject
if *v == nil {
sv = &types.S3SignedObject{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BucketName to be of type string, got %T instead", value)
}
sv.BucketName = ptr.String(jtv)
}
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Key to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentS3Source(v **types.S3Source, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3Source
if *v == nil {
sv = &types.S3Source{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BucketName to be of type string, got %T instead", value)
}
sv.BucketName = ptr.String(jtv)
}
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Key to be of type string, got %T instead", value)
}
sv.Key = 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 awsRestjson1_deserializeDocumentServiceLimitExceededException(v **types.ServiceLimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ServiceLimitExceededException
if *v == nil {
sv = &types.ServiceLimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSignatureValidityPeriod(v **types.SignatureValidityPeriod, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SignatureValidityPeriod
if *v == nil {
sv = &types.SignatureValidityPeriod{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidityType to be of type string, got %T instead", value)
}
sv.Type = types.ValidityType(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Value = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSignedObject(v **types.SignedObject, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SignedObject
if *v == nil {
sv = &types.SignedObject{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3":
if err := awsRestjson1_deserializeDocumentS3SignedObject(&sv.S3, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningConfiguration(v **types.SigningConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningConfiguration
if *v == nil {
sv = &types.SigningConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "encryptionAlgorithmOptions":
if err := awsRestjson1_deserializeDocumentEncryptionAlgorithmOptions(&sv.EncryptionAlgorithmOptions, value); err != nil {
return err
}
case "hashAlgorithmOptions":
if err := awsRestjson1_deserializeDocumentHashAlgorithmOptions(&sv.HashAlgorithmOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningConfigurationOverrides(v **types.SigningConfigurationOverrides, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningConfigurationOverrides
if *v == nil {
sv = &types.SigningConfigurationOverrides{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "encryptionAlgorithm":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionAlgorithm to be of type string, got %T instead", value)
}
sv.EncryptionAlgorithm = types.EncryptionAlgorithm(jtv)
}
case "hashAlgorithm":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HashAlgorithm to be of type string, got %T instead", value)
}
sv.HashAlgorithm = types.HashAlgorithm(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningImageFormat(v **types.SigningImageFormat, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningImageFormat
if *v == nil {
sv = &types.SigningImageFormat{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageFormat to be of type string, got %T instead", value)
}
sv.DefaultFormat = types.ImageFormat(jtv)
}
case "supportedFormats":
if err := awsRestjson1_deserializeDocumentImageFormats(&sv.SupportedFormats, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningJob(v **types.SigningJob, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningJob
if *v == nil {
sv = &types.SigningJob{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "isRevoked":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected bool to be of type *bool, got %T instead", value)
}
sv.IsRevoked = jtv
}
case "jobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "jobInvoker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobInvoker = ptr.String(jtv)
}
case "jobOwner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountId to be of type string, got %T instead", value)
}
sv.JobOwner = ptr.String(jtv)
}
case "platformDisplayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.PlatformDisplayName = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlatformId to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "profileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value)
}
sv.ProfileName = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "signatureExpiresAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SignatureExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "signedObject":
if err := awsRestjson1_deserializeDocumentSignedObject(&sv.SignedObject, value); err != nil {
return err
}
case "signingMaterial":
if err := awsRestjson1_deserializeDocumentSigningMaterial(&sv.SigningMaterial, value); err != nil {
return err
}
case "source":
if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SigningStatus to be of type string, got %T instead", value)
}
sv.Status = types.SigningStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningJobRevocationRecord(v **types.SigningJobRevocationRecord, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningJobRevocationRecord
if *v == nil {
sv = &types.SigningJobRevocationRecord{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "revokedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.RevokedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "revokedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RevokedBy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningJobs(v *[]types.SigningJob, 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.SigningJob
if *v == nil {
cv = []types.SigningJob{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SigningJob
destAddr := &col
if err := awsRestjson1_deserializeDocumentSigningJob(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSigningMaterial(v **types.SigningMaterial, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningMaterial
if *v == nil {
sv = &types.SigningMaterial{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "certificateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
}
sv.CertificateArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningParameters(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 SigningParameterValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentSigningPlatform(v **types.SigningPlatform, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningPlatform
if *v == nil {
sv = &types.SigningPlatform{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Category to be of type string, got %T instead", value)
}
sv.Category = types.Category(jtv)
}
case "displayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DisplayName = ptr.String(jtv)
}
case "maxSizeInMB":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxSizeInMB to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxSizeInMB = int32(i64)
}
case "partner":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Partner = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "revocationSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected bool to be of type *bool, got %T instead", value)
}
sv.RevocationSupported = jtv
}
case "signingConfiguration":
if err := awsRestjson1_deserializeDocumentSigningConfiguration(&sv.SigningConfiguration, value); err != nil {
return err
}
case "signingImageFormat":
if err := awsRestjson1_deserializeDocumentSigningImageFormat(&sv.SigningImageFormat, value); err != nil {
return err
}
case "target":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Target = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningPlatformOverrides(v **types.SigningPlatformOverrides, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningPlatformOverrides
if *v == nil {
sv = &types.SigningPlatformOverrides{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "signingConfiguration":
if err := awsRestjson1_deserializeDocumentSigningConfigurationOverrides(&sv.SigningConfiguration, value); err != nil {
return err
}
case "signingImageFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageFormat to be of type string, got %T instead", value)
}
sv.SigningImageFormat = types.ImageFormat(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningPlatforms(v *[]types.SigningPlatform, 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.SigningPlatform
if *v == nil {
cv = []types.SigningPlatform{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SigningPlatform
destAddr := &col
if err := awsRestjson1_deserializeDocumentSigningPlatform(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSigningProfile(v **types.SigningProfile, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningProfile
if *v == nil {
sv = &types.SigningProfile{}
} 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 String to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "platformDisplayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.PlatformDisplayName = ptr.String(jtv)
}
case "platformId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlatformId to be of type string, got %T instead", value)
}
sv.PlatformId = ptr.String(jtv)
}
case "profileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileName to be of type string, got %T instead", value)
}
sv.ProfileName = ptr.String(jtv)
}
case "profileVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProfileVersion to be of type string, got %T instead", value)
}
sv.ProfileVersion = ptr.String(jtv)
}
case "profileVersionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ProfileVersionArn = ptr.String(jtv)
}
case "signatureValidityPeriod":
if err := awsRestjson1_deserializeDocumentSignatureValidityPeriod(&sv.SignatureValidityPeriod, value); err != nil {
return err
}
case "signingMaterial":
if err := awsRestjson1_deserializeDocumentSigningMaterial(&sv.SigningMaterial, value); err != nil {
return err
}
case "signingParameters":
if err := awsRestjson1_deserializeDocumentSigningParameters(&sv.SigningParameters, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SigningProfileStatus to be of type string, got %T instead", value)
}
sv.Status = types.SigningProfileStatus(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningProfileRevocationRecord(v **types.SigningProfileRevocationRecord, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SigningProfileRevocationRecord
if *v == nil {
sv = &types.SigningProfileRevocationRecord{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "revocationEffectiveFrom":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.RevocationEffectiveFrom = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "revokedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.RevokedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "revokedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RevokedBy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSigningProfiles(v *[]types.SigningProfile, 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.SigningProfile
if *v == nil {
cv = []types.SigningProfile{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SigningProfile
destAddr := &col
if err := awsRestjson1_deserializeDocumentSigningProfile(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSource(v **types.Source, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Source
if *v == nil {
sv = &types.Source{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3":
if err := awsRestjson1_deserializeDocumentS3Source(&sv.S3, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
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_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 ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
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 "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 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 "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 5,547 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package signer provides the API client, operations, and parameter types for AWS
// Signer.
//
// AWS Signer is a fully managed code signing service to help you ensure the trust
// and integrity of your code. AWS Signer supports the following applications: With
// code signing for AWS Lambda, you can sign AWS Lambda (http://docs.aws.amazon.com/lambda/latest/dg/)
// deployment packages. Integrated support is provided for Amazon S3 (http://docs.aws.amazon.com/AmazonS3/latest/gsg/)
// , Amazon CloudWatch (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/)
// , and AWS CloudTrail (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/)
// . In order to sign code, you create a signing profile and then use Signer to
// sign Lambda zip files in S3. With code signing for IoT, you can sign code for
// any IoT device that is supported by AWS. IoT code signing is available for
// Amazon FreeRTOS (http://docs.aws.amazon.com/freertos/latest/userguide/) and AWS
// IoT Device Management (http://docs.aws.amazon.com/iot/latest/developerguide/) ,
// and is integrated with AWS Certificate Manager (ACM) (http://docs.aws.amazon.com/acm/latest/userguide/)
// . In order to sign code, you import a third-party code signing certificate using
// ACM, and use that to sign updates in Amazon FreeRTOS and AWS IoT Device
// Management. With code signing for containers …(TBD) For more information about
// AWS Signer, see the AWS Signer Developer Guide (https://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html)
// .
package signer
| 24 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
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/signer/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 = "signer"
}
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 signer
// 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 signer
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/signer/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"
)
type awsRestjson1_serializeOpAddProfilePermission struct {
}
func (*awsRestjson1_serializeOpAddProfilePermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAddProfilePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddProfilePermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/permissions")
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_serializeOpHttpBindingsAddProfilePermissionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAddProfilePermissionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAddProfilePermissionInput(v *AddProfilePermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAddProfilePermissionInput(v *AddProfilePermissionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("action")
ok.String(*v.Action)
}
if v.Principal != nil {
ok := object.Key("principal")
ok.String(*v.Principal)
}
if v.ProfileVersion != nil {
ok := object.Key("profileVersion")
ok.String(*v.ProfileVersion)
}
if v.RevisionId != nil {
ok := object.Key("revisionId")
ok.String(*v.RevisionId)
}
if v.StatementId != nil {
ok := object.Key("statementId")
ok.String(*v.StatementId)
}
return nil
}
type awsRestjson1_serializeOpCancelSigningProfile struct {
}
func (*awsRestjson1_serializeOpCancelSigningProfile) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCancelSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CancelSigningProfileInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}")
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_serializeOpHttpBindingsCancelSigningProfileInput(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_serializeOpHttpBindingsCancelSigningProfileInput(v *CancelSigningProfileInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeSigningJob struct {
}
func (*awsRestjson1_serializeOpDescribeSigningJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeSigningJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSigningJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-jobs/{jobId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeSigningJobInput(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_serializeOpHttpBindingsDescribeSigningJobInput(v *DescribeSigningJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("jobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetRevocationStatus struct {
}
func (*awsRestjson1_serializeOpGetRevocationStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetRevocationStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRevocationStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/revocations")
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_serializeOpHttpBindingsGetRevocationStatusInput(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_serializeOpHttpBindingsGetRevocationStatusInput(v *GetRevocationStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CertificateHashes != nil {
for i := range v.CertificateHashes {
encoder.AddQuery("certificateHashes").String(v.CertificateHashes[i])
}
}
if v.JobArn != nil {
encoder.SetQuery("jobArn").String(*v.JobArn)
}
if v.PlatformId != nil {
encoder.SetQuery("platformId").String(*v.PlatformId)
}
if v.ProfileVersionArn != nil {
encoder.SetQuery("profileVersionArn").String(*v.ProfileVersionArn)
}
if v.SignatureTimestamp != nil {
encoder.SetQuery("signatureTimestamp").String(smithytime.FormatDateTime(*v.SignatureTimestamp))
}
return nil
}
type awsRestjson1_serializeOpGetSigningPlatform struct {
}
func (*awsRestjson1_serializeOpGetSigningPlatform) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSigningPlatform) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSigningPlatformInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-platforms/{platformId}")
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_serializeOpHttpBindingsGetSigningPlatformInput(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_serializeOpHttpBindingsGetSigningPlatformInput(v *GetSigningPlatformInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PlatformId == nil || len(*v.PlatformId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member platformId must not be empty")}
}
if v.PlatformId != nil {
if err := encoder.SetURI("platformId").String(*v.PlatformId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetSigningProfile struct {
}
func (*awsRestjson1_serializeOpGetSigningProfile) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSigningProfileInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}")
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_serializeOpHttpBindingsGetSigningProfileInput(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_serializeOpHttpBindingsGetSigningProfileInput(v *GetSigningProfileInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
if v.ProfileOwner != nil {
encoder.SetQuery("profileOwner").String(*v.ProfileOwner)
}
return nil
}
type awsRestjson1_serializeOpListProfilePermissions struct {
}
func (*awsRestjson1_serializeOpListProfilePermissions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProfilePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListProfilePermissionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/permissions")
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_serializeOpHttpBindingsListProfilePermissionsInput(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_serializeOpHttpBindingsListProfilePermissionsInput(v *ListProfilePermissionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListSigningJobs struct {
}
func (*awsRestjson1_serializeOpListSigningJobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSigningJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSigningJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-jobs")
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_serializeOpHttpBindingsListSigningJobsInput(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_serializeOpHttpBindingsListSigningJobsInput(v *ListSigningJobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IsRevoked {
encoder.SetQuery("isRevoked").Boolean(v.IsRevoked)
}
if v.JobInvoker != nil {
encoder.SetQuery("jobInvoker").String(*v.JobInvoker)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PlatformId != nil {
encoder.SetQuery("platformId").String(*v.PlatformId)
}
if v.RequestedBy != nil {
encoder.SetQuery("requestedBy").String(*v.RequestedBy)
}
if v.SignatureExpiresAfter != nil {
encoder.SetQuery("signatureExpiresAfter").String(smithytime.FormatDateTime(*v.SignatureExpiresAfter))
}
if v.SignatureExpiresBefore != nil {
encoder.SetQuery("signatureExpiresBefore").String(smithytime.FormatDateTime(*v.SignatureExpiresBefore))
}
if len(v.Status) > 0 {
encoder.SetQuery("status").String(string(v.Status))
}
return nil
}
type awsRestjson1_serializeOpListSigningPlatforms struct {
}
func (*awsRestjson1_serializeOpListSigningPlatforms) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSigningPlatforms) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSigningPlatformsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-platforms")
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_serializeOpHttpBindingsListSigningPlatformsInput(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_serializeOpHttpBindingsListSigningPlatformsInput(v *ListSigningPlatformsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Category != nil {
encoder.SetQuery("category").String(*v.Category)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.Partner != nil {
encoder.SetQuery("partner").String(*v.Partner)
}
if v.Target != nil {
encoder.SetQuery("target").String(*v.Target)
}
return nil
}
type awsRestjson1_serializeOpListSigningProfiles struct {
}
func (*awsRestjson1_serializeOpListSigningProfiles) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSigningProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSigningProfilesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListSigningProfilesInput(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_serializeOpHttpBindingsListSigningProfilesInput(v *ListSigningProfilesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IncludeCanceled {
encoder.SetQuery("includeCanceled").Boolean(v.IncludeCanceled)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PlatformId != nil {
encoder.SetQuery("platformId").String(*v.PlatformId)
}
if v.Statuses != nil {
for i := range v.Statuses {
encoder.AddQuery("statuses").String(string(v.Statuses[i]))
}
}
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_serializeOpPutSigningProfile struct {
}
func (*awsRestjson1_serializeOpPutSigningProfile) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutSigningProfileInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutSigningProfileInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutSigningProfileInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutSigningProfileInput(v *PutSigningProfileInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutSigningProfileInput(v *PutSigningProfileInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Overrides != nil {
ok := object.Key("overrides")
if err := awsRestjson1_serializeDocumentSigningPlatformOverrides(v.Overrides, ok); err != nil {
return err
}
}
if v.PlatformId != nil {
ok := object.Key("platformId")
ok.String(*v.PlatformId)
}
if v.SignatureValidityPeriod != nil {
ok := object.Key("signatureValidityPeriod")
if err := awsRestjson1_serializeDocumentSignatureValidityPeriod(v.SignatureValidityPeriod, ok); err != nil {
return err
}
}
if v.SigningMaterial != nil {
ok := object.Key("signingMaterial")
if err := awsRestjson1_serializeDocumentSigningMaterial(v.SigningMaterial, ok); err != nil {
return err
}
}
if v.SigningParameters != nil {
ok := object.Key("signingParameters")
if err := awsRestjson1_serializeDocumentSigningParameters(v.SigningParameters, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpRemoveProfilePermission struct {
}
func (*awsRestjson1_serializeOpRemoveProfilePermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRemoveProfilePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveProfilePermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/permissions/{statementId}")
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_serializeOpHttpBindingsRemoveProfilePermissionInput(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_serializeOpHttpBindingsRemoveProfilePermissionInput(v *RemoveProfilePermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
if v.RevisionId != nil {
encoder.SetQuery("revisionId").String(*v.RevisionId)
}
if v.StatementId == nil || len(*v.StatementId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member statementId must not be empty")}
}
if v.StatementId != nil {
if err := encoder.SetURI("statementId").String(*v.StatementId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpRevokeSignature struct {
}
func (*awsRestjson1_serializeOpRevokeSignature) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRevokeSignature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RevokeSignatureInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-jobs/{jobId}/revoke")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsRevokeSignatureInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRevokeSignatureInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsRevokeSignatureInput(v *RevokeSignatureInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("jobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentRevokeSignatureInput(v *RevokeSignatureInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobOwner != nil {
ok := object.Key("jobOwner")
ok.String(*v.JobOwner)
}
if v.Reason != nil {
ok := object.Key("reason")
ok.String(*v.Reason)
}
return nil
}
type awsRestjson1_serializeOpRevokeSigningProfile struct {
}
func (*awsRestjson1_serializeOpRevokeSigningProfile) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRevokeSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RevokeSigningProfileInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/revoke")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsRevokeSigningProfileInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRevokeSigningProfileInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsRevokeSigningProfileInput(v *RevokeSigningProfileInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProfileName == nil || len(*v.ProfileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")}
}
if v.ProfileName != nil {
if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentRevokeSigningProfileInput(v *RevokeSigningProfileInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EffectiveTime != nil {
ok := object.Key("effectiveTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EffectiveTime))
}
if v.ProfileVersion != nil {
ok := object.Key("profileVersion")
ok.String(*v.ProfileVersion)
}
if v.Reason != nil {
ok := object.Key("reason")
ok.String(*v.Reason)
}
return nil
}
type awsRestjson1_serializeOpSignPayload struct {
}
func (*awsRestjson1_serializeOpSignPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSignPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SignPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-jobs/with-payload")
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_serializeOpDocumentSignPayloadInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSignPayloadInput(v *SignPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSignPayloadInput(v *SignPayloadInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Payload != nil {
ok := object.Key("payload")
ok.Base64EncodeBytes(v.Payload)
}
if v.PayloadFormat != nil {
ok := object.Key("payloadFormat")
ok.String(*v.PayloadFormat)
}
if v.ProfileName != nil {
ok := object.Key("profileName")
ok.String(*v.ProfileName)
}
if v.ProfileOwner != nil {
ok := object.Key("profileOwner")
ok.String(*v.ProfileOwner)
}
return nil
}
type awsRestjson1_serializeOpStartSigningJob struct {
}
func (*awsRestjson1_serializeOpStartSigningJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartSigningJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartSigningJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/signing-jobs")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartSigningJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartSigningJobInput(v *StartSigningJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartSigningJobInput(v *StartSigningJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientRequestToken != nil {
ok := object.Key("clientRequestToken")
ok.String(*v.ClientRequestToken)
}
if v.Destination != nil {
ok := object.Key("destination")
if err := awsRestjson1_serializeDocumentDestination(v.Destination, ok); err != nil {
return err
}
}
if v.ProfileName != nil {
ok := object.Key("profileName")
ok.String(*v.ProfileName)
}
if v.ProfileOwner != nil {
ok := object.Key("profileOwner")
ok.String(*v.ProfileOwner)
}
if v.Source != nil {
ok := object.Key("source")
if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_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
}
func awsRestjson1_serializeDocumentDestination(v *types.Destination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3 != nil {
ok := object.Key("s3")
if err := awsRestjson1_serializeDocumentS3Destination(v.S3, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.Prefix != nil {
ok := object.Key("prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsRestjson1_serializeDocumentS3Source(v *types.S3Source, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.Version != nil {
ok := object.Key("version")
ok.String(*v.Version)
}
return nil
}
func awsRestjson1_serializeDocumentSignatureValidityPeriod(v *types.SignatureValidityPeriod, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
if v.Value != 0 {
ok := object.Key("value")
ok.Integer(v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentSigningConfigurationOverrides(v *types.SigningConfigurationOverrides, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EncryptionAlgorithm) > 0 {
ok := object.Key("encryptionAlgorithm")
ok.String(string(v.EncryptionAlgorithm))
}
if len(v.HashAlgorithm) > 0 {
ok := object.Key("hashAlgorithm")
ok.String(string(v.HashAlgorithm))
}
return nil
}
func awsRestjson1_serializeDocumentSigningMaterial(v *types.SigningMaterial, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateArn != nil {
ok := object.Key("certificateArn")
ok.String(*v.CertificateArn)
}
return nil
}
func awsRestjson1_serializeDocumentSigningParameters(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_serializeDocumentSigningPlatformOverrides(v *types.SigningPlatformOverrides, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SigningConfiguration != nil {
ok := object.Key("signingConfiguration")
if err := awsRestjson1_serializeDocumentSigningConfigurationOverrides(v.SigningConfiguration, ok); err != nil {
return err
}
}
if len(v.SigningImageFormat) > 0 {
ok := object.Key("signingImageFormat")
ok.String(string(v.SigningImageFormat))
}
return nil
}
func awsRestjson1_serializeDocumentSource(v *types.Source, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3 != nil {
ok := object.Key("s3")
if err := awsRestjson1_serializeDocumentS3Source(v.S3, ok); err != nil {
return err
}
}
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
}
| 1,610 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package signer
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/signer/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddProfilePermission struct {
}
func (*validateOpAddProfilePermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddProfilePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddProfilePermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddProfilePermissionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCancelSigningProfile struct {
}
func (*validateOpCancelSigningProfile) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelSigningProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelSigningProfileInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelSigningProfileInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSigningJob struct {
}
func (*validateOpDescribeSigningJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSigningJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSigningJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSigningJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRevocationStatus struct {
}
func (*validateOpGetRevocationStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRevocationStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRevocationStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRevocationStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSigningPlatform struct {
}
func (*validateOpGetSigningPlatform) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSigningPlatform) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSigningPlatformInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSigningPlatformInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSigningProfile struct {
}
func (*validateOpGetSigningProfile) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSigningProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSigningProfileInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSigningProfileInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListProfilePermissions struct {
}
func (*validateOpListProfilePermissions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListProfilePermissions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListProfilePermissionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListProfilePermissionsInput(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 validateOpPutSigningProfile struct {
}
func (*validateOpPutSigningProfile) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutSigningProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutSigningProfileInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutSigningProfileInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveProfilePermission struct {
}
func (*validateOpRemoveProfilePermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveProfilePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveProfilePermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveProfilePermissionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRevokeSignature struct {
}
func (*validateOpRevokeSignature) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRevokeSignature) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RevokeSignatureInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRevokeSignatureInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRevokeSigningProfile struct {
}
func (*validateOpRevokeSigningProfile) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRevokeSigningProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RevokeSigningProfileInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRevokeSigningProfileInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSignPayload struct {
}
func (*validateOpSignPayload) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSignPayload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SignPayloadInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSignPayloadInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartSigningJob struct {
}
func (*validateOpStartSigningJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartSigningJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartSigningJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartSigningJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddProfilePermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddProfilePermission{}, middleware.After)
}
func addOpCancelSigningProfileValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelSigningProfile{}, middleware.After)
}
func addOpDescribeSigningJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSigningJob{}, middleware.After)
}
func addOpGetRevocationStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRevocationStatus{}, middleware.After)
}
func addOpGetSigningPlatformValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSigningPlatform{}, middleware.After)
}
func addOpGetSigningProfileValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSigningProfile{}, middleware.After)
}
func addOpListProfilePermissionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListProfilePermissions{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutSigningProfileValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutSigningProfile{}, middleware.After)
}
func addOpRemoveProfilePermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveProfilePermission{}, middleware.After)
}
func addOpRevokeSignatureValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRevokeSignature{}, middleware.After)
}
func addOpRevokeSigningProfileValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRevokeSigningProfile{}, middleware.After)
}
func addOpSignPayloadValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSignPayload{}, middleware.After)
}
func addOpStartSigningJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartSigningJob{}, 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 validateS3Source(v *types.S3Source) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3Source"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSigningMaterial(v *types.SigningMaterial) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SigningMaterial"}
if v.CertificateArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSource(v *types.Source) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Source"}
if v.S3 != nil {
if err := validateS3Source(v.S3); err != nil {
invalidParams.AddNested("S3", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddProfilePermissionInput(v *AddProfilePermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddProfilePermissionInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.Principal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principal"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelSigningProfileInput(v *CancelSigningProfileInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelSigningProfileInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSigningJobInput(v *DescribeSigningJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSigningJobInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRevocationStatusInput(v *GetRevocationStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRevocationStatusInput"}
if v.SignatureTimestamp == nil {
invalidParams.Add(smithy.NewErrParamRequired("SignatureTimestamp"))
}
if v.PlatformId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PlatformId"))
}
if v.ProfileVersionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileVersionArn"))
}
if v.JobArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobArn"))
}
if v.CertificateHashes == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateHashes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSigningPlatformInput(v *GetSigningPlatformInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSigningPlatformInput"}
if v.PlatformId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PlatformId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSigningProfileInput(v *GetSigningProfileInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSigningProfileInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListProfilePermissionsInput(v *ListProfilePermissionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListProfilePermissionsInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
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 validateOpPutSigningProfileInput(v *PutSigningProfileInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutSigningProfileInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.SigningMaterial != nil {
if err := validateSigningMaterial(v.SigningMaterial); err != nil {
invalidParams.AddNested("SigningMaterial", err.(smithy.InvalidParamsError))
}
}
if v.PlatformId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PlatformId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveProfilePermissionInput(v *RemoveProfilePermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveProfilePermissionInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.RevisionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RevisionId"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRevokeSignatureInput(v *RevokeSignatureInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RevokeSignatureInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if v.Reason == nil {
invalidParams.Add(smithy.NewErrParamRequired("Reason"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRevokeSigningProfileInput(v *RevokeSigningProfileInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RevokeSigningProfileInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.ProfileVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileVersion"))
}
if v.Reason == nil {
invalidParams.Add(smithy.NewErrParamRequired("Reason"))
}
if v.EffectiveTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EffectiveTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSignPayloadInput(v *SignPayloadInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SignPayloadInput"}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.Payload == nil {
invalidParams.Add(smithy.NewErrParamRequired("Payload"))
}
if v.PayloadFormat == nil {
invalidParams.Add(smithy.NewErrParamRequired("PayloadFormat"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartSigningJobInput(v *StartSigningJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartSigningJobInput"}
if v.Source == nil {
invalidParams.Add(smithy.NewErrParamRequired("Source"))
} else if v.Source != nil {
if err := validateSource(v.Source); err != nil {
invalidParams.AddNested("Source", err.(smithy.InvalidParamsError))
}
}
if v.Destination == nil {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
}
if v.ProfileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProfileName"))
}
if v.ClientRequestToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken"))
}
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
}
}
| 761 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.