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 robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a robot application. func (c *Client) DescribeRobotApplication(ctx context.Context, params *DescribeRobotApplicationInput, optFns ...func(*Options)) (*DescribeRobotApplicationOutput, error) { if params == nil { params = &DescribeRobotApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeRobotApplication", params, optFns, c.addOperationDescribeRobotApplicationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeRobotApplicationOutput) out.ResultMetadata = metadata return out, nil } type DescribeRobotApplicationInput struct { // The Amazon Resource Name (ARN) of the robot application. // // This member is required. Application *string // The version of the robot application to describe. ApplicationVersion *string noSmithyDocumentSerde } type DescribeRobotApplicationOutput struct { // The Amazon Resource Name (ARN) of the robot application. Arn *string // The object that contains the Docker image URI used to create the robot // application. Environment *types.Environment // A SHA256 identifier for the Docker image that you use for your robot // application. ImageDigest *string // The time, in milliseconds since the epoch, when the robot application was last // updated. LastUpdatedAt *time.Time // The name of the robot application. Name *string // The revision id of the robot application. RevisionId *string // The robot software suite (ROS distribution) used by the robot application. RobotSoftwareSuite *types.RobotSoftwareSuite // The sources of the robot application. Sources []types.Source // The list of all tags added to the specified robot application. Tags map[string]string // The version of the robot application. Version *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeRobotApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRobotApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRobotApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeRobotApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRobotApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeRobotApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeRobotApplication", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a simulation application. func (c *Client) DescribeSimulationApplication(ctx context.Context, params *DescribeSimulationApplicationInput, optFns ...func(*Options)) (*DescribeSimulationApplicationOutput, error) { if params == nil { params = &DescribeSimulationApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSimulationApplication", params, optFns, c.addOperationDescribeSimulationApplicationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSimulationApplicationOutput) out.ResultMetadata = metadata return out, nil } type DescribeSimulationApplicationInput struct { // The application information for the simulation application. // // This member is required. Application *string // The version of the simulation application to describe. ApplicationVersion *string noSmithyDocumentSerde } type DescribeSimulationApplicationOutput struct { // The Amazon Resource Name (ARN) of the robot simulation application. Arn *string // The object that contains the Docker image URI used to create the simulation // application. Environment *types.Environment // A SHA256 identifier for the Docker image that you use for your simulation // application. ImageDigest *string // The time, in milliseconds since the epoch, when the simulation application was // last updated. LastUpdatedAt *time.Time // The name of the simulation application. Name *string // The rendering engine for the simulation application. RenderingEngine *types.RenderingEngine // The revision id of the simulation application. RevisionId *string // Information about the robot software suite (ROS distribution). RobotSoftwareSuite *types.RobotSoftwareSuite // The simulation software suite used by the simulation application. SimulationSoftwareSuite *types.SimulationSoftwareSuite // The sources of the simulation application. Sources []types.Source // The list of all tags added to the specified simulation application. Tags map[string]string // The version of the simulation application. Version *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSimulationApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSimulationApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSimulationApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSimulationApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSimulationApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSimulationApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeSimulationApplication", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a simulation job. func (c *Client) DescribeSimulationJob(ctx context.Context, params *DescribeSimulationJobInput, optFns ...func(*Options)) (*DescribeSimulationJobOutput, error) { if params == nil { params = &DescribeSimulationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSimulationJob", params, optFns, c.addOperationDescribeSimulationJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSimulationJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeSimulationJobInput struct { // The Amazon Resource Name (ARN) of the simulation job to be described. // // This member is required. Job *string noSmithyDocumentSerde } type DescribeSimulationJobOutput struct { // The Amazon Resource Name (ARN) of the simulation job. Arn *string // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // Compute information for the simulation job. Compute *types.ComputeResponse // The data sources for the simulation job. DataSources []types.DataSource // The failure behavior for the simulation job. FailureBehavior types.FailureBehavior // The failure code of the simulation job if it failed: InternalServiceError // Internal service error. RobotApplicationCrash Robot application exited // abnormally. SimulationApplicationCrash Simulation application exited abnormally. // BadPermissionsRobotApplication Robot application bundle could not be downloaded. // BadPermissionsSimulationApplication Simulation application bundle could not be // downloaded. BadPermissionsS3Output Unable to publish outputs to // customer-provided S3 bucket. BadPermissionsCloudwatchLogs Unable to publish logs // to customer-provided CloudWatch Logs resource. SubnetIpLimitExceeded Subnet IP // limit exceeded. ENILimitExceeded ENI limit exceeded. // BadPermissionsUserCredentials Unable to use the Role provided. // InvalidBundleRobotApplication Robot bundle cannot be extracted (invalid format, // bundling error, or other issue). InvalidBundleSimulationApplication Simulation // bundle cannot be extracted (invalid format, bundling error, or other issue). // RobotApplicationVersionMismatchedEtag Etag for RobotApplication does not match // value during version creation. SimulationApplicationVersionMismatchedEtag Etag // for SimulationApplication does not match value during version creation. FailureCode types.SimulationJobErrorCode // Details about why the simulation job failed. For more information about // troubleshooting, see Troubleshooting (https://docs.aws.amazon.com/robomaker/latest/dg/troubleshooting.html) // . FailureReason *string // The IAM role that allows the simulation instance to call the AWS APIs that are // specified in its associated policies on your behalf. IamRole *string // The time, in milliseconds since the epoch, when the simulation job was last // started. LastStartedAt *time.Time // The time, in milliseconds since the epoch, when the simulation job was last // updated. LastUpdatedAt *time.Time // The logging configuration. LoggingConfig *types.LoggingConfig // The maximum job duration in seconds. The value must be 8 days (691,200 seconds) // or less. MaxJobDurationInSeconds int64 // The name of the simulation job. Name *string // The network interface information for the simulation job. NetworkInterface *types.NetworkInterface // Location for output files generated by the simulation job. OutputLocation *types.OutputLocation // A list of robot applications. RobotApplications []types.RobotApplicationConfig // A list of simulation applications. SimulationApplications []types.SimulationApplicationConfig // The simulation job execution duration in milliseconds. SimulationTimeMillis int64 // The status of the simulation job. Status types.SimulationJobStatus // The list of all tags added to the specified simulation job. Tags map[string]string // The VPC configuration. VpcConfig *types.VPCConfigResponse // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSimulationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSimulationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSimulationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSimulationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSimulationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSimulationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeSimulationJob", } }
208
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a simulation job batch. func (c *Client) DescribeSimulationJobBatch(ctx context.Context, params *DescribeSimulationJobBatchInput, optFns ...func(*Options)) (*DescribeSimulationJobBatchOutput, error) { if params == nil { params = &DescribeSimulationJobBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSimulationJobBatch", params, optFns, c.addOperationDescribeSimulationJobBatchMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSimulationJobBatchOutput) out.ResultMetadata = metadata return out, nil } type DescribeSimulationJobBatchInput struct { // The id of the batch to describe. // // This member is required. Batch *string noSmithyDocumentSerde } type DescribeSimulationJobBatchOutput struct { // The Amazon Resource Name (ARN) of the batch. Arn *string // The batch policy. BatchPolicy *types.BatchPolicy // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // The time, in milliseconds since the epoch, when the simulation job batch was // created. CreatedAt *time.Time // A list of created simulation job summaries. CreatedRequests []types.SimulationJobSummary // A list of failed create simulation job requests. The request failed to be // created into a simulation job. Failed requests do not have a simulation job ID. FailedRequests []types.FailedCreateSimulationJobRequest // The failure code of the simulation job batch. FailureCode types.SimulationJobBatchErrorCode // The reason the simulation job batch failed. FailureReason *string // The time, in milliseconds since the epoch, when the simulation job batch was // last updated. LastUpdatedAt *time.Time // A list of pending simulation job requests. These requests have not yet been // created into simulation jobs. PendingRequests []types.SimulationJobRequest // The status of the batch. Pending The simulation job batch request is pending. // InProgress The simulation job batch is in progress. Failed The simulation job // batch failed. One or more simulation job requests could not be completed due to // an internal failure (like InternalServiceError ). See failureCode and // failureReason for more information. Completed The simulation batch job // completed. A batch is complete when (1) there are no pending simulation job // requests in the batch and none of the failed simulation job requests are due to // InternalServiceError and (2) when all created simulation jobs have reached a // terminal state (for example, Completed or Failed ). Canceled The simulation // batch job was cancelled. Canceling The simulation batch job is being cancelled. // Completing The simulation batch job is completing. TimingOut The simulation job // batch is timing out. If a batch timing out, and there are pending requests that // were failing due to an internal failure (like InternalServiceError ), the batch // status will be Failed . If there are no such failing request, the batch status // will be TimedOut . TimedOut The simulation batch job timed out. Status types.SimulationJobBatchStatus // A map that contains tag keys and tag values that are attached to the simulation // job batch. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSimulationJobBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSimulationJobBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSimulationJobBatch{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSimulationJobBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSimulationJobBatch(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSimulationJobBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeSimulationJobBatch", } }
179
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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" ) // Describes a world. func (c *Client) DescribeWorld(ctx context.Context, params *DescribeWorldInput, optFns ...func(*Options)) (*DescribeWorldOutput, error) { if params == nil { params = &DescribeWorldInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorld", params, optFns, c.addOperationDescribeWorldMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorldOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorldInput struct { // The Amazon Resource Name (arn) of the world you want to describe. // // This member is required. World *string noSmithyDocumentSerde } type DescribeWorldOutput struct { // The Amazon Resource Name (arn) of the world. Arn *string // The time, in milliseconds since the epoch, when the world was created. CreatedAt *time.Time // The Amazon Resource Name (arn) of the world generation job that generated the // world. GenerationJob *string // A map that contains tag keys and tag values that are attached to the world. Tags map[string]string // The world template. Template *string // Returns the JSON formatted string that describes the contents of your world. WorldDescriptionBody *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorldMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeWorld{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeWorld{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeWorldValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorld(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeWorld(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeWorld", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a world export job. func (c *Client) DescribeWorldExportJob(ctx context.Context, params *DescribeWorldExportJobInput, optFns ...func(*Options)) (*DescribeWorldExportJobOutput, error) { if params == nil { params = &DescribeWorldExportJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorldExportJob", params, optFns, c.addOperationDescribeWorldExportJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorldExportJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorldExportJobInput struct { // The Amazon Resource Name (arn) of the world export job to describe. // // This member is required. Job *string noSmithyDocumentSerde } type DescribeWorldExportJobOutput struct { // The Amazon Resource Name (ARN) of the world export job. Arn *string // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // The time, in milliseconds since the epoch, when the world export job was // created. CreatedAt *time.Time // The failure code of the world export job if it failed: InternalServiceError // Internal service error. LimitExceeded The requested resource exceeds the maximum // number allowed, or the number of concurrent stream requests exceeds the maximum // number allowed. ResourceNotFound The specified resource could not be found. // RequestThrottled The request was throttled. InvalidInput An input parameter in // the request is not valid. FailureCode types.WorldExportJobErrorCode // The reason why the world export job failed. FailureReason *string // The IAM role that the world export process uses to access the Amazon S3 bucket // and put the export. IamRole *string // The output location. OutputLocation *types.OutputLocation // The status of the world export job. Pending The world export job request is // pending. Running The world export job is running. Completed The world export job // completed. Failed The world export job failed. See failureCode and failureReason // for more information. Canceled The world export job was cancelled. Canceling The // world export job is being cancelled. Status types.WorldExportJobStatus // A map that contains tag keys and tag values that are attached to the world // export job. Tags map[string]string // A list of Amazon Resource Names (arns) that correspond to worlds to be exported. Worlds []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorldExportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeWorldExportJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeWorldExportJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeWorldExportJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorldExportJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeWorldExportJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeWorldExportJob", } }
166
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a world generation job. func (c *Client) DescribeWorldGenerationJob(ctx context.Context, params *DescribeWorldGenerationJobInput, optFns ...func(*Options)) (*DescribeWorldGenerationJobOutput, error) { if params == nil { params = &DescribeWorldGenerationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorldGenerationJob", params, optFns, c.addOperationDescribeWorldGenerationJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorldGenerationJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorldGenerationJobInput struct { // The Amazon Resource Name (arn) of the world generation job to describe. // // This member is required. Job *string noSmithyDocumentSerde } type DescribeWorldGenerationJobOutput struct { // The Amazon Resource Name (ARN) of the world generation job. Arn *string // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // The time, in milliseconds since the epoch, when the world generation job was // created. CreatedAt *time.Time // The failure code of the world generation job if it failed: InternalServiceError // Internal service error. LimitExceeded The requested resource exceeds the maximum // number allowed, or the number of concurrent stream requests exceeds the maximum // number allowed. ResourceNotFound The specified resource could not be found. // RequestThrottled The request was throttled. InvalidInput An input parameter in // the request is not valid. FailureCode types.WorldGenerationJobErrorCode // The reason why the world generation job failed. FailureReason *string // Summary information about finished worlds. FinishedWorldsSummary *types.FinishedWorldsSummary // The status of the world generation job: Pending The world generation job // request is pending. Running The world generation job is running. Completed The // world generation job completed. Failed The world generation job failed. See // failureCode for more information. PartialFailed Some worlds did not generate. // Canceled The world generation job was cancelled. Canceling The world generation // job is being cancelled. Status types.WorldGenerationJobStatus // A map that contains tag keys and tag values that are attached to the world // generation job. Tags map[string]string // The Amazon Resource Name (arn) of the world template. Template *string // Information about the world count. WorldCount *types.WorldCount // A map that contains tag keys and tag values that are attached to the generated // worlds. WorldTags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorldGenerationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeWorldGenerationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeWorldGenerationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeWorldGenerationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorldGenerationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeWorldGenerationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeWorldGenerationJob", } }
170
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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" ) // Describes a world template. func (c *Client) DescribeWorldTemplate(ctx context.Context, params *DescribeWorldTemplateInput, optFns ...func(*Options)) (*DescribeWorldTemplateOutput, error) { if params == nil { params = &DescribeWorldTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorldTemplate", params, optFns, c.addOperationDescribeWorldTemplateMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorldTemplateOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorldTemplateInput struct { // The Amazon Resource Name (arn) of the world template you want to describe. // // This member is required. Template *string noSmithyDocumentSerde } type DescribeWorldTemplateOutput struct { // The Amazon Resource Name (ARN) of the world template. Arn *string // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // The time, in milliseconds since the epoch, when the world template was created. CreatedAt *time.Time // The time, in milliseconds since the epoch, when the world template was last // updated. LastUpdatedAt *time.Time // The name of the world template. Name *string // A map that contains tag keys and tag values that are attached to the world // template. Tags map[string]string // The version of the world template that you're using. Version *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorldTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeWorldTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeWorldTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeWorldTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorldTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeWorldTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "DescribeWorldTemplate", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the world template body. func (c *Client) GetWorldTemplateBody(ctx context.Context, params *GetWorldTemplateBodyInput, optFns ...func(*Options)) (*GetWorldTemplateBodyOutput, error) { if params == nil { params = &GetWorldTemplateBodyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetWorldTemplateBody", params, optFns, c.addOperationGetWorldTemplateBodyMiddlewares) if err != nil { return nil, err } out := result.(*GetWorldTemplateBodyOutput) out.ResultMetadata = metadata return out, nil } type GetWorldTemplateBodyInput struct { // The Amazon Resource Name (arn) of the world generator job. GenerationJob *string // The Amazon Resource Name (arn) of the world template. Template *string noSmithyDocumentSerde } type GetWorldTemplateBodyOutput struct { // The world template body. TemplateBody *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetWorldTemplateBodyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorldTemplateBody{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorldTemplateBody{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetWorldTemplateBody(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetWorldTemplateBody(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "GetWorldTemplateBody", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of deployment jobs for a fleet. You can optionally provide // filters to retrieve specific deployment jobs. This API will no longer be // supported as of May 2, 2022. Use it to remove resources that were created for // Deployment Service. // // Deprecated: Support for the AWS RoboMaker application deployment feature has // ended. For additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html. func (c *Client) ListDeploymentJobs(ctx context.Context, params *ListDeploymentJobsInput, optFns ...func(*Options)) (*ListDeploymentJobsOutput, error) { if params == nil { params = &ListDeploymentJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDeploymentJobs", params, optFns, c.addOperationListDeploymentJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListDeploymentJobsOutput) out.ResultMetadata = metadata return out, nil } type ListDeploymentJobsInput struct { // Optional filters to limit results. The filter names status and fleetName are // supported. When filtering, you must use the complete value of the filtered item. // You can use up to three filters, but they must be for the same named item. For // example, if you are looking for items with the status InProgress or the status // Pending . Filters []types.Filter // When this parameter is used, ListDeploymentJobs only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListDeploymentJobs // request with the returned nextToken value. This value can be between 1 and 200. // If this parameter is not used, then ListDeploymentJobs returns up to 200 // results and a nextToken value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListDeploymentJobs again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListDeploymentJobsOutput struct { // A list of deployment jobs that meet the criteria of the request. DeploymentJobs []types.DeploymentJob // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListDeploymentJobs again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDeploymentJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeploymentJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeploymentJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListDeploymentJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDeploymentJobsAPIClient is a client that implements the ListDeploymentJobs // operation. type ListDeploymentJobsAPIClient interface { ListDeploymentJobs(context.Context, *ListDeploymentJobsInput, ...func(*Options)) (*ListDeploymentJobsOutput, error) } var _ ListDeploymentJobsAPIClient = (*Client)(nil) // ListDeploymentJobsPaginatorOptions is the paginator options for // ListDeploymentJobs type ListDeploymentJobsPaginatorOptions struct { // When this parameter is used, ListDeploymentJobs only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListDeploymentJobs // request with the returned nextToken value. This value can be between 1 and 200. // If this parameter is not used, then ListDeploymentJobs returns up to 200 // results and a nextToken value if applicable. 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 } // ListDeploymentJobsPaginator is a paginator for ListDeploymentJobs type ListDeploymentJobsPaginator struct { options ListDeploymentJobsPaginatorOptions client ListDeploymentJobsAPIClient params *ListDeploymentJobsInput nextToken *string firstPage bool } // NewListDeploymentJobsPaginator returns a new ListDeploymentJobsPaginator func NewListDeploymentJobsPaginator(client ListDeploymentJobsAPIClient, params *ListDeploymentJobsInput, optFns ...func(*ListDeploymentJobsPaginatorOptions)) *ListDeploymentJobsPaginator { if params == nil { params = &ListDeploymentJobsInput{} } options := ListDeploymentJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDeploymentJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDeploymentJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDeploymentJobs page. func (p *ListDeploymentJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentJobsOutput, 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.ListDeploymentJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListDeploymentJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListDeploymentJobs", } }
250
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of fleets. You can optionally provide filters to retrieve // specific fleets. This API will no longer be supported as of May 2, 2022. Use it // to remove resources that were created for Deployment Service. // // Deprecated: Support for the AWS RoboMaker application deployment feature has // ended. For additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html. func (c *Client) ListFleets(ctx context.Context, params *ListFleetsInput, optFns ...func(*Options)) (*ListFleetsOutput, error) { if params == nil { params = &ListFleetsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListFleets", params, optFns, c.addOperationListFleetsMiddlewares) if err != nil { return nil, err } out := result.(*ListFleetsOutput) out.ResultMetadata = metadata return out, nil } type ListFleetsInput struct { // Optional filters to limit results. The filter name name is supported. When // filtering, you must use the complete value of the filtered item. You can use up // to three filters. Filters []types.Filter // When this parameter is used, ListFleets only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListFleets request with the // returned nextToken value. This value can be between 1 and 200. If this // parameter is not used, then ListFleets returns up to 200 results and a nextToken // value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListFleets again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. This token should // be treated as an opaque identifier that is only used to retrieve the next items // in a list and not for other programmatic purposes. NextToken *string noSmithyDocumentSerde } type ListFleetsOutput struct { // A list of fleet details meeting the request criteria. FleetDetails []types.Fleet // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListFleets again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListFleets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFleets{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListFleets(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListFleetsAPIClient is a client that implements the ListFleets operation. type ListFleetsAPIClient interface { ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) } var _ ListFleetsAPIClient = (*Client)(nil) // ListFleetsPaginatorOptions is the paginator options for ListFleets type ListFleetsPaginatorOptions struct { // When this parameter is used, ListFleets only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListFleets request with the // returned nextToken value. This value can be between 1 and 200. If this // parameter is not used, then ListFleets returns up to 200 results and a nextToken // value if applicable. 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 } // ListFleetsPaginator is a paginator for ListFleets type ListFleetsPaginator struct { options ListFleetsPaginatorOptions client ListFleetsAPIClient params *ListFleetsInput nextToken *string firstPage bool } // NewListFleetsPaginator returns a new ListFleetsPaginator func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { if params == nil { params = &ListFleetsInput{} } options := ListFleetsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListFleetsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListFleetsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListFleets page. func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, 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.ListFleets(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListFleets", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of robot application. You can optionally provide filters to // retrieve specific robot applications. func (c *Client) ListRobotApplications(ctx context.Context, params *ListRobotApplicationsInput, optFns ...func(*Options)) (*ListRobotApplicationsOutput, error) { if params == nil { params = &ListRobotApplicationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListRobotApplications", params, optFns, c.addOperationListRobotApplicationsMiddlewares) if err != nil { return nil, err } out := result.(*ListRobotApplicationsOutput) out.ResultMetadata = metadata return out, nil } type ListRobotApplicationsInput struct { // Optional filters to limit results. The filter name name is supported. When // filtering, you must use the complete value of the filtered item. You can use up // to three filters. Filters []types.Filter // When this parameter is used, ListRobotApplications only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListRobotApplications request with the returned nextToken value. This value can // be between 1 and 100. If this parameter is not used, then ListRobotApplications // returns up to 100 results and a nextToken value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListRobotApplications again and assign that token // to the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string // The version qualifier of the robot application. VersionQualifier *string noSmithyDocumentSerde } type ListRobotApplicationsOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListRobotApplications again and assign that token // to the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string // A list of robot application summaries that meet the criteria of the request. RobotApplicationSummaries []types.RobotApplicationSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListRobotApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListRobotApplications{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRobotApplications{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListRobotApplications(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListRobotApplicationsAPIClient is a client that implements the // ListRobotApplications operation. type ListRobotApplicationsAPIClient interface { ListRobotApplications(context.Context, *ListRobotApplicationsInput, ...func(*Options)) (*ListRobotApplicationsOutput, error) } var _ ListRobotApplicationsAPIClient = (*Client)(nil) // ListRobotApplicationsPaginatorOptions is the paginator options for // ListRobotApplications type ListRobotApplicationsPaginatorOptions struct { // When this parameter is used, ListRobotApplications only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListRobotApplications request with the returned nextToken value. This value can // be between 1 and 100. If this parameter is not used, then ListRobotApplications // returns up to 100 results and a nextToken value if applicable. 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 } // ListRobotApplicationsPaginator is a paginator for ListRobotApplications type ListRobotApplicationsPaginator struct { options ListRobotApplicationsPaginatorOptions client ListRobotApplicationsAPIClient params *ListRobotApplicationsInput nextToken *string firstPage bool } // NewListRobotApplicationsPaginator returns a new ListRobotApplicationsPaginator func NewListRobotApplicationsPaginator(client ListRobotApplicationsAPIClient, params *ListRobotApplicationsInput, optFns ...func(*ListRobotApplicationsPaginatorOptions)) *ListRobotApplicationsPaginator { if params == nil { params = &ListRobotApplicationsInput{} } options := ListRobotApplicationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListRobotApplicationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListRobotApplicationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListRobotApplications page. func (p *ListRobotApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotApplicationsOutput, 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.ListRobotApplications(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListRobotApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListRobotApplications", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of robots. You can optionally provide filters to retrieve // specific robots. This API will no longer be supported as of May 2, 2022. Use it // to remove resources that were created for Deployment Service. // // Deprecated: Support for the AWS RoboMaker application deployment feature has // ended. For additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html. func (c *Client) ListRobots(ctx context.Context, params *ListRobotsInput, optFns ...func(*Options)) (*ListRobotsOutput, error) { if params == nil { params = &ListRobotsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListRobots", params, optFns, c.addOperationListRobotsMiddlewares) if err != nil { return nil, err } out := result.(*ListRobotsOutput) out.ResultMetadata = metadata return out, nil } type ListRobotsInput struct { // Optional filters to limit results. The filter names status and fleetName are // supported. When filtering, you must use the complete value of the filtered item. // You can use up to three filters, but they must be for the same named item. For // example, if you are looking for items with the status Registered or the status // Available . Filters []types.Filter // When this parameter is used, ListRobots only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListRobots request with the // returned nextToken value. This value can be between 1 and 200. If this // parameter is not used, then ListRobots returns up to 200 results and a nextToken // value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListRobots again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListRobotsOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListRobots again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. NextToken *string // A list of robots that meet the criteria of the request. Robots []types.Robot // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListRobotsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListRobots{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRobots{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListRobots(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListRobotsAPIClient is a client that implements the ListRobots operation. type ListRobotsAPIClient interface { ListRobots(context.Context, *ListRobotsInput, ...func(*Options)) (*ListRobotsOutput, error) } var _ ListRobotsAPIClient = (*Client)(nil) // ListRobotsPaginatorOptions is the paginator options for ListRobots type ListRobotsPaginatorOptions struct { // When this parameter is used, ListRobots only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListRobots request with the // returned nextToken value. This value can be between 1 and 200. If this // parameter is not used, then ListRobots returns up to 200 results and a nextToken // value if applicable. 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 } // ListRobotsPaginator is a paginator for ListRobots type ListRobotsPaginator struct { options ListRobotsPaginatorOptions client ListRobotsAPIClient params *ListRobotsInput nextToken *string firstPage bool } // NewListRobotsPaginator returns a new ListRobotsPaginator func NewListRobotsPaginator(client ListRobotsAPIClient, params *ListRobotsInput, optFns ...func(*ListRobotsPaginatorOptions)) *ListRobotsPaginator { if params == nil { params = &ListRobotsInput{} } options := ListRobotsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListRobotsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListRobotsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListRobots page. func (p *ListRobotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotsOutput, 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.ListRobots(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListRobots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListRobots", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of simulation applications. You can optionally provide filters // to retrieve specific simulation applications. func (c *Client) ListSimulationApplications(ctx context.Context, params *ListSimulationApplicationsInput, optFns ...func(*Options)) (*ListSimulationApplicationsOutput, error) { if params == nil { params = &ListSimulationApplicationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSimulationApplications", params, optFns, c.addOperationListSimulationApplicationsMiddlewares) if err != nil { return nil, err } out := result.(*ListSimulationApplicationsOutput) out.ResultMetadata = metadata return out, nil } type ListSimulationApplicationsInput struct { // Optional list of filters to limit results. The filter name name is supported. // When filtering, you must use the complete value of the filtered item. You can // use up to three filters. Filters []types.Filter // When this parameter is used, ListSimulationApplications only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListSimulationApplications request with the returned nextToken value. This // value can be between 1 and 100. If this parameter is not used, then // ListSimulationApplications returns up to 100 results and a nextToken value if // applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationApplications again and assign that // token to the request object's nextToken parameter. If there are no remaining // results, the previous response object's NextToken parameter is set to null. NextToken *string // The version qualifier of the simulation application. VersionQualifier *string noSmithyDocumentSerde } type ListSimulationApplicationsOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationApplications again and assign that // token to the request object's nextToken parameter. If there are no remaining // results, the previous response object's NextToken parameter is set to null. NextToken *string // A list of simulation application summaries that meet the criteria of the // request. SimulationApplicationSummaries []types.SimulationApplicationSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSimulationApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSimulationApplications{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSimulationApplications{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSimulationApplications(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSimulationApplicationsAPIClient is a client that implements the // ListSimulationApplications operation. type ListSimulationApplicationsAPIClient interface { ListSimulationApplications(context.Context, *ListSimulationApplicationsInput, ...func(*Options)) (*ListSimulationApplicationsOutput, error) } var _ ListSimulationApplicationsAPIClient = (*Client)(nil) // ListSimulationApplicationsPaginatorOptions is the paginator options for // ListSimulationApplications type ListSimulationApplicationsPaginatorOptions struct { // When this parameter is used, ListSimulationApplications only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListSimulationApplications request with the returned nextToken value. This // value can be between 1 and 100. If this parameter is not used, then // ListSimulationApplications returns up to 100 results and a nextToken value if // applicable. 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 } // ListSimulationApplicationsPaginator is a paginator for // ListSimulationApplications type ListSimulationApplicationsPaginator struct { options ListSimulationApplicationsPaginatorOptions client ListSimulationApplicationsAPIClient params *ListSimulationApplicationsInput nextToken *string firstPage bool } // NewListSimulationApplicationsPaginator returns a new // ListSimulationApplicationsPaginator func NewListSimulationApplicationsPaginator(client ListSimulationApplicationsAPIClient, params *ListSimulationApplicationsInput, optFns ...func(*ListSimulationApplicationsPaginatorOptions)) *ListSimulationApplicationsPaginator { if params == nil { params = &ListSimulationApplicationsInput{} } options := ListSimulationApplicationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSimulationApplicationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSimulationApplicationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSimulationApplications page. func (p *ListSimulationApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationApplicationsOutput, 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.ListSimulationApplications(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSimulationApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListSimulationApplications", } }
250
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list simulation job batches. You can optionally provide filters to // retrieve specific simulation batch jobs. func (c *Client) ListSimulationJobBatches(ctx context.Context, params *ListSimulationJobBatchesInput, optFns ...func(*Options)) (*ListSimulationJobBatchesOutput, error) { if params == nil { params = &ListSimulationJobBatchesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSimulationJobBatches", params, optFns, c.addOperationListSimulationJobBatchesMiddlewares) if err != nil { return nil, err } out := result.(*ListSimulationJobBatchesOutput) out.ResultMetadata = metadata return out, nil } type ListSimulationJobBatchesInput struct { // Optional filters to limit results. Filters []types.Filter // When this parameter is used, ListSimulationJobBatches only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListSimulationJobBatches request with the returned nextToken value. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationJobBatches again and assign that // token to the request object's nextToken parameter. If there are no remaining // results, the previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListSimulationJobBatchesOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationJobBatches again and assign that // token to the request object's nextToken parameter. If there are no remaining // results, the previous response object's NextToken parameter is set to null. NextToken *string // A list of simulation job batch summaries. SimulationJobBatchSummaries []types.SimulationJobBatchSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSimulationJobBatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSimulationJobBatches{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSimulationJobBatches{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSimulationJobBatches(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSimulationJobBatchesAPIClient is a client that implements the // ListSimulationJobBatches operation. type ListSimulationJobBatchesAPIClient interface { ListSimulationJobBatches(context.Context, *ListSimulationJobBatchesInput, ...func(*Options)) (*ListSimulationJobBatchesOutput, error) } var _ ListSimulationJobBatchesAPIClient = (*Client)(nil) // ListSimulationJobBatchesPaginatorOptions is the paginator options for // ListSimulationJobBatches type ListSimulationJobBatchesPaginatorOptions struct { // When this parameter is used, ListSimulationJobBatches only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListSimulationJobBatches request with the returned nextToken value. 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 } // ListSimulationJobBatchesPaginator is a paginator for ListSimulationJobBatches type ListSimulationJobBatchesPaginator struct { options ListSimulationJobBatchesPaginatorOptions client ListSimulationJobBatchesAPIClient params *ListSimulationJobBatchesInput nextToken *string firstPage bool } // NewListSimulationJobBatchesPaginator returns a new // ListSimulationJobBatchesPaginator func NewListSimulationJobBatchesPaginator(client ListSimulationJobBatchesAPIClient, params *ListSimulationJobBatchesInput, optFns ...func(*ListSimulationJobBatchesPaginatorOptions)) *ListSimulationJobBatchesPaginator { if params == nil { params = &ListSimulationJobBatchesInput{} } options := ListSimulationJobBatchesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSimulationJobBatchesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSimulationJobBatchesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSimulationJobBatches page. func (p *ListSimulationJobBatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobBatchesOutput, 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.ListSimulationJobBatches(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSimulationJobBatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListSimulationJobBatches", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of simulation jobs. You can optionally provide filters to // retrieve specific simulation jobs. func (c *Client) ListSimulationJobs(ctx context.Context, params *ListSimulationJobsInput, optFns ...func(*Options)) (*ListSimulationJobsOutput, error) { if params == nil { params = &ListSimulationJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSimulationJobs", params, optFns, c.addOperationListSimulationJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListSimulationJobsOutput) out.ResultMetadata = metadata return out, nil } type ListSimulationJobsInput struct { // Optional filters to limit results. The filter names status and // simulationApplicationName and robotApplicationName are supported. When // filtering, you must use the complete value of the filtered item. You can use up // to three filters, but they must be for the same named item. For example, if you // are looking for items with the status Preparing or the status Running . Filters []types.Filter // When this parameter is used, ListSimulationJobs only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListSimulationJobs // request with the returned nextToken value. This value can be between 1 and // 1000. If this parameter is not used, then ListSimulationJobs returns up to 1000 // results and a nextToken value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationJobs again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListSimulationJobsOutput struct { // A list of simulation job summaries that meet the criteria of the request. // // This member is required. SimulationJobSummaries []types.SimulationJobSummary // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListSimulationJobs again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSimulationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSimulationJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSimulationJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSimulationJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSimulationJobsAPIClient is a client that implements the ListSimulationJobs // operation. type ListSimulationJobsAPIClient interface { ListSimulationJobs(context.Context, *ListSimulationJobsInput, ...func(*Options)) (*ListSimulationJobsOutput, error) } var _ ListSimulationJobsAPIClient = (*Client)(nil) // ListSimulationJobsPaginatorOptions is the paginator options for // ListSimulationJobs type ListSimulationJobsPaginatorOptions struct { // When this parameter is used, ListSimulationJobs only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListSimulationJobs // request with the returned nextToken value. This value can be between 1 and // 1000. If this parameter is not used, then ListSimulationJobs returns up to 1000 // results and a nextToken value if applicable. 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 } // ListSimulationJobsPaginator is a paginator for ListSimulationJobs type ListSimulationJobsPaginator struct { options ListSimulationJobsPaginatorOptions client ListSimulationJobsAPIClient params *ListSimulationJobsInput nextToken *string firstPage bool } // NewListSimulationJobsPaginator returns a new ListSimulationJobsPaginator func NewListSimulationJobsPaginator(client ListSimulationJobsAPIClient, params *ListSimulationJobsInput, optFns ...func(*ListSimulationJobsPaginatorOptions)) *ListSimulationJobsPaginator { if params == nil { params = &ListSimulationJobsInput{} } options := ListSimulationJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSimulationJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSimulationJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSimulationJobs page. func (p *ListSimulationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobsOutput, 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.ListSimulationJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSimulationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListSimulationJobs", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all tags on a AWS RoboMaker 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 AWS RoboMaker Amazon Resource Name (ARN) with tags to be listed. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The list of all tags added to the specified resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListTagsForResource", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists world export jobs. func (c *Client) ListWorldExportJobs(ctx context.Context, params *ListWorldExportJobsInput, optFns ...func(*Options)) (*ListWorldExportJobsOutput, error) { if params == nil { params = &ListWorldExportJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorldExportJobs", params, optFns, c.addOperationListWorldExportJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListWorldExportJobsOutput) out.ResultMetadata = metadata return out, nil } type ListWorldExportJobsInput struct { // Optional filters to limit results. You can use generationJobId and templateId . Filters []types.Filter // When this parameter is used, ListWorldExportJobs only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListWorldExportJobs request with the returned nextToken value. This value can // be between 1 and 100. If this parameter is not used, then ListWorldExportJobs // returns up to 100 results and a nextToken value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldExportJobs again and assign that token // to the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListWorldExportJobsOutput struct { // Summary information for world export jobs. // // This member is required. WorldExportJobSummaries []types.WorldExportJobSummary // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldExportJobsRequest again and assign that // token to the request object's nextToken parameter. If there are no remaining // results, the previous response object's NextToken parameter is set to null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorldExportJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorldExportJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorldExportJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorldExportJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListWorldExportJobsAPIClient is a client that implements the // ListWorldExportJobs operation. type ListWorldExportJobsAPIClient interface { ListWorldExportJobs(context.Context, *ListWorldExportJobsInput, ...func(*Options)) (*ListWorldExportJobsOutput, error) } var _ ListWorldExportJobsAPIClient = (*Client)(nil) // ListWorldExportJobsPaginatorOptions is the paginator options for // ListWorldExportJobs type ListWorldExportJobsPaginatorOptions struct { // When this parameter is used, ListWorldExportJobs only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListWorldExportJobs request with the returned nextToken value. This value can // be between 1 and 100. If this parameter is not used, then ListWorldExportJobs // returns up to 100 results and a nextToken value if applicable. 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 } // ListWorldExportJobsPaginator is a paginator for ListWorldExportJobs type ListWorldExportJobsPaginator struct { options ListWorldExportJobsPaginatorOptions client ListWorldExportJobsAPIClient params *ListWorldExportJobsInput nextToken *string firstPage bool } // NewListWorldExportJobsPaginator returns a new ListWorldExportJobsPaginator func NewListWorldExportJobsPaginator(client ListWorldExportJobsAPIClient, params *ListWorldExportJobsInput, optFns ...func(*ListWorldExportJobsPaginatorOptions)) *ListWorldExportJobsPaginator { if params == nil { params = &ListWorldExportJobsInput{} } options := ListWorldExportJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorldExportJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorldExportJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorldExportJobs page. func (p *ListWorldExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldExportJobsOutput, 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.ListWorldExportJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListWorldExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListWorldExportJobs", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists world generator jobs. func (c *Client) ListWorldGenerationJobs(ctx context.Context, params *ListWorldGenerationJobsInput, optFns ...func(*Options)) (*ListWorldGenerationJobsOutput, error) { if params == nil { params = &ListWorldGenerationJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorldGenerationJobs", params, optFns, c.addOperationListWorldGenerationJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListWorldGenerationJobsOutput) out.ResultMetadata = metadata return out, nil } type ListWorldGenerationJobsInput struct { // Optional filters to limit results. You can use status and templateId . Filters []types.Filter // When this parameter is used, ListWorldGeneratorJobs only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListWorldGeneratorJobs request with the returned nextToken value. This value // can be between 1 and 100. If this parameter is not used, then // ListWorldGeneratorJobs returns up to 100 results and a nextToken value if // applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldGenerationJobsRequest again and assign // that token to the request object's nextToken parameter. If there are no // remaining results, the previous response object's NextToken parameter is set to // null. NextToken *string noSmithyDocumentSerde } type ListWorldGenerationJobsOutput struct { // Summary information for world generator jobs. // // This member is required. WorldGenerationJobSummaries []types.WorldGenerationJobSummary // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldGeneratorJobsRequest again and assign // that token to the request object's nextToken parameter. If there are no // remaining results, the previous response object's NextToken parameter is set to // null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorldGenerationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorldGenerationJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorldGenerationJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorldGenerationJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListWorldGenerationJobsAPIClient is a client that implements the // ListWorldGenerationJobs operation. type ListWorldGenerationJobsAPIClient interface { ListWorldGenerationJobs(context.Context, *ListWorldGenerationJobsInput, ...func(*Options)) (*ListWorldGenerationJobsOutput, error) } var _ ListWorldGenerationJobsAPIClient = (*Client)(nil) // ListWorldGenerationJobsPaginatorOptions is the paginator options for // ListWorldGenerationJobs type ListWorldGenerationJobsPaginatorOptions struct { // When this parameter is used, ListWorldGeneratorJobs only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another // ListWorldGeneratorJobs request with the returned nextToken value. This value // can be between 1 and 100. If this parameter is not used, then // ListWorldGeneratorJobs returns up to 100 results and a nextToken value if // applicable. 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 } // ListWorldGenerationJobsPaginator is a paginator for ListWorldGenerationJobs type ListWorldGenerationJobsPaginator struct { options ListWorldGenerationJobsPaginatorOptions client ListWorldGenerationJobsAPIClient params *ListWorldGenerationJobsInput nextToken *string firstPage bool } // NewListWorldGenerationJobsPaginator returns a new // ListWorldGenerationJobsPaginator func NewListWorldGenerationJobsPaginator(client ListWorldGenerationJobsAPIClient, params *ListWorldGenerationJobsInput, optFns ...func(*ListWorldGenerationJobsPaginatorOptions)) *ListWorldGenerationJobsPaginator { if params == nil { params = &ListWorldGenerationJobsInput{} } options := ListWorldGenerationJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorldGenerationJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorldGenerationJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorldGenerationJobs page. func (p *ListWorldGenerationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldGenerationJobsOutput, 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.ListWorldGenerationJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListWorldGenerationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListWorldGenerationJobs", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists worlds. func (c *Client) ListWorlds(ctx context.Context, params *ListWorldsInput, optFns ...func(*Options)) (*ListWorldsOutput, error) { if params == nil { params = &ListWorldsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorlds", params, optFns, c.addOperationListWorldsMiddlewares) if err != nil { return nil, err } out := result.(*ListWorldsOutput) out.ResultMetadata = metadata return out, nil } type ListWorldsInput struct { // Optional filters to limit results. You can use status . Filters []types.Filter // When this parameter is used, ListWorlds only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListWorlds request with the // returned nextToken value. This value can be between 1 and 100. If this // parameter is not used, then ListWorlds returns up to 100 results and a nextToken // value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorlds again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListWorldsOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorlds again and assign that token to the // request object's nextToken parameter. If there are no remaining results, the // previous response object's NextToken parameter is set to null. NextToken *string // Summary information for worlds. WorldSummaries []types.WorldSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorldsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorlds{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorlds{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorlds(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListWorldsAPIClient is a client that implements the ListWorlds operation. type ListWorldsAPIClient interface { ListWorlds(context.Context, *ListWorldsInput, ...func(*Options)) (*ListWorldsOutput, error) } var _ ListWorldsAPIClient = (*Client)(nil) // ListWorldsPaginatorOptions is the paginator options for ListWorlds type ListWorldsPaginatorOptions struct { // When this parameter is used, ListWorlds only returns maxResults results in a // single page along with a nextToken response element. The remaining results of // the initial request can be seen by sending another ListWorlds request with the // returned nextToken value. This value can be between 1 and 100. If this // parameter is not used, then ListWorlds returns up to 100 results and a nextToken // value if applicable. 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 } // ListWorldsPaginator is a paginator for ListWorlds type ListWorldsPaginator struct { options ListWorldsPaginatorOptions client ListWorldsAPIClient params *ListWorldsInput nextToken *string firstPage bool } // NewListWorldsPaginator returns a new ListWorldsPaginator func NewListWorldsPaginator(client ListWorldsAPIClient, params *ListWorldsInput, optFns ...func(*ListWorldsPaginatorOptions)) *ListWorldsPaginator { if params == nil { params = &ListWorldsInput{} } options := ListWorldsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorldsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorldsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorlds page. func (p *ListWorldsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldsOutput, 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.ListWorlds(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListWorlds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListWorlds", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists world templates. func (c *Client) ListWorldTemplates(ctx context.Context, params *ListWorldTemplatesInput, optFns ...func(*Options)) (*ListWorldTemplatesOutput, error) { if params == nil { params = &ListWorldTemplatesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorldTemplates", params, optFns, c.addOperationListWorldTemplatesMiddlewares) if err != nil { return nil, err } out := result.(*ListWorldTemplatesOutput) out.ResultMetadata = metadata return out, nil } type ListWorldTemplatesInput struct { // When this parameter is used, ListWorldTemplates only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListWorldTemplates // request with the returned nextToken value. This value can be between 1 and 100. // If this parameter is not used, then ListWorldTemplates returns up to 100 // results and a nextToken value if applicable. MaxResults *int32 // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldTemplates again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string noSmithyDocumentSerde } type ListWorldTemplatesOutput struct { // If the previous paginated request did not return all of the remaining results, // the response object's nextToken parameter value is set to a token. To retrieve // the next set of results, call ListWorldTemplates again and assign that token to // the request object's nextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string // Summary information for templates. TemplateSummaries []types.TemplateSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorldTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorldTemplates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorldTemplates{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorldTemplates(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListWorldTemplatesAPIClient is a client that implements the ListWorldTemplates // operation. type ListWorldTemplatesAPIClient interface { ListWorldTemplates(context.Context, *ListWorldTemplatesInput, ...func(*Options)) (*ListWorldTemplatesOutput, error) } var _ ListWorldTemplatesAPIClient = (*Client)(nil) // ListWorldTemplatesPaginatorOptions is the paginator options for // ListWorldTemplates type ListWorldTemplatesPaginatorOptions struct { // When this parameter is used, ListWorldTemplates only returns maxResults results // in a single page along with a nextToken response element. The remaining results // of the initial request can be seen by sending another ListWorldTemplates // request with the returned nextToken value. This value can be between 1 and 100. // If this parameter is not used, then ListWorldTemplates returns up to 100 // results and a nextToken value if applicable. 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 } // ListWorldTemplatesPaginator is a paginator for ListWorldTemplates type ListWorldTemplatesPaginator struct { options ListWorldTemplatesPaginatorOptions client ListWorldTemplatesAPIClient params *ListWorldTemplatesInput nextToken *string firstPage bool } // NewListWorldTemplatesPaginator returns a new ListWorldTemplatesPaginator func NewListWorldTemplatesPaginator(client ListWorldTemplatesAPIClient, params *ListWorldTemplatesInput, optFns ...func(*ListWorldTemplatesPaginatorOptions)) *ListWorldTemplatesPaginator { if params == nil { params = &ListWorldTemplatesInput{} } options := ListWorldTemplatesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorldTemplatesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorldTemplatesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorldTemplates page. func (p *ListWorldTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldTemplatesOutput, 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.ListWorldTemplates(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListWorldTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "ListWorldTemplates", } }
236
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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" ) // Registers a robot with a fleet. This API is no longer supported and will throw // an error if used. // // Deprecated: AWS RoboMaker is unable to process this request as the support for // the AWS RoboMaker application deployment feature has ended. For additional // information, see https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html. func (c *Client) RegisterRobot(ctx context.Context, params *RegisterRobotInput, optFns ...func(*Options)) (*RegisterRobotOutput, error) { if params == nil { params = &RegisterRobotInput{} } result, metadata, err := c.invokeOperation(ctx, "RegisterRobot", params, optFns, c.addOperationRegisterRobotMiddlewares) if err != nil { return nil, err } out := result.(*RegisterRobotOutput) out.ResultMetadata = metadata return out, nil } type RegisterRobotInput struct { // The Amazon Resource Name (ARN) of the fleet. // // This member is required. Fleet *string // The Amazon Resource Name (ARN) of the robot. // // This member is required. Robot *string noSmithyDocumentSerde } type RegisterRobotOutput struct { // The Amazon Resource Name (ARN) of the fleet that the robot will join. Fleet *string // Information about the robot registration. Robot *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRegisterRobotMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterRobot{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterRobot{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRegisterRobotValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterRobot(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRegisterRobot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "RegisterRobot", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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" ) // Restarts a running simulation job. func (c *Client) RestartSimulationJob(ctx context.Context, params *RestartSimulationJobInput, optFns ...func(*Options)) (*RestartSimulationJobOutput, error) { if params == nil { params = &RestartSimulationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "RestartSimulationJob", params, optFns, c.addOperationRestartSimulationJobMiddlewares) if err != nil { return nil, err } out := result.(*RestartSimulationJobOutput) out.ResultMetadata = metadata return out, nil } type RestartSimulationJobInput struct { // The Amazon Resource Name (ARN) of the simulation job. // // This member is required. Job *string noSmithyDocumentSerde } type RestartSimulationJobOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRestartSimulationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRestartSimulationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRestartSimulationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRestartSimulationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestartSimulationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRestartSimulationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "RestartSimulationJob", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Starts a new simulation job batch. The batch is defined using one or more // SimulationJobRequest objects. func (c *Client) StartSimulationJobBatch(ctx context.Context, params *StartSimulationJobBatchInput, optFns ...func(*Options)) (*StartSimulationJobBatchOutput, error) { if params == nil { params = &StartSimulationJobBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "StartSimulationJobBatch", params, optFns, c.addOperationStartSimulationJobBatchMiddlewares) if err != nil { return nil, err } out := result.(*StartSimulationJobBatchOutput) out.ResultMetadata = metadata return out, nil } type StartSimulationJobBatchInput struct { // A list of simulation job requests to create in the batch. // // This member is required. CreateSimulationJobRequests []types.SimulationJobRequest // The batch policy. BatchPolicy *types.BatchPolicy // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // A map that contains tag keys and tag values that are attached to the deployment // job batch. Tags map[string]string noSmithyDocumentSerde } type StartSimulationJobBatchOutput struct { // The Amazon Resource Name (arn) of the batch. Arn *string // The batch policy. BatchPolicy *types.BatchPolicy // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. ClientRequestToken *string // The time, in milliseconds since the epoch, when the simulation job batch was // created. CreatedAt *time.Time // A list of created simulation job request summaries. CreatedRequests []types.SimulationJobSummary // A list of failed simulation job requests. The request failed to be created into // a simulation job. Failed requests do not have a simulation job ID. FailedRequests []types.FailedCreateSimulationJobRequest // The failure code if the simulation job batch failed. FailureCode types.SimulationJobBatchErrorCode // The reason the simulation job batch failed. FailureReason *string // A list of pending simulation job requests. These requests have not yet been // created into simulation jobs. PendingRequests []types.SimulationJobRequest // The status of the simulation job batch. Pending The simulation job batch // request is pending. InProgress The simulation job batch is in progress. Failed // The simulation job batch failed. One or more simulation job requests could not // be completed due to an internal failure (like InternalServiceError ). See // failureCode and failureReason for more information. Completed The simulation // batch job completed. A batch is complete when (1) there are no pending // simulation job requests in the batch and none of the failed simulation job // requests are due to InternalServiceError and (2) when all created simulation // jobs have reached a terminal state (for example, Completed or Failed ). Canceled // The simulation batch job was cancelled. Canceling The simulation batch job is // being cancelled. Completing The simulation batch job is completing. TimingOut // The simulation job batch is timing out. If a batch timing out, and there are // pending requests that were failing due to an internal failure (like // InternalServiceError ), the batch status will be Failed . If there are no such // failing request, the batch status will be TimedOut . TimedOut The simulation // batch job timed out. Status types.SimulationJobBatchStatus // A map that contains tag keys and tag values that are attached to the deployment // job batch. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartSimulationJobBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSimulationJobBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSimulationJobBatch{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opStartSimulationJobBatchMiddleware(stack, options); err != nil { return err } if err = addOpStartSimulationJobBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSimulationJobBatch(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpStartSimulationJobBatch struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartSimulationJobBatch) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartSimulationJobBatch) 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.(*StartSimulationJobBatchInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartSimulationJobBatchInput ") } 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_opStartSimulationJobBatchMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartSimulationJobBatch{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartSimulationJobBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "StartSimulationJobBatch", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Syncrhonizes robots in a fleet to the latest deployment. This is helpful if // robots were added after a deployment. This API will no longer be supported as of // May 2, 2022. Use it to remove resources that were created for Deployment // Service. // // Deprecated: Support for the AWS RoboMaker application deployment feature has // ended. For additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html. func (c *Client) SyncDeploymentJob(ctx context.Context, params *SyncDeploymentJobInput, optFns ...func(*Options)) (*SyncDeploymentJobOutput, error) { if params == nil { params = &SyncDeploymentJobInput{} } result, metadata, err := c.invokeOperation(ctx, "SyncDeploymentJob", params, optFns, c.addOperationSyncDeploymentJobMiddlewares) if err != nil { return nil, err } out := result.(*SyncDeploymentJobOutput) out.ResultMetadata = metadata return out, nil } type SyncDeploymentJobInput struct { // Unique, case-sensitive identifier that you provide to ensure the idempotency of // the request. // // This member is required. ClientRequestToken *string // The target fleet for the synchronization. // // This member is required. Fleet *string noSmithyDocumentSerde } type SyncDeploymentJobOutput struct { // The Amazon Resource Name (ARN) of the synchronization request. Arn *string // The time, in milliseconds since the epoch, when the fleet was created. CreatedAt *time.Time // Information about the deployment application configurations. DeploymentApplicationConfigs []types.DeploymentApplicationConfig // Information about the deployment configuration. DeploymentConfig *types.DeploymentConfig // The failure code if the job fails: InternalServiceError Internal service error. // RobotApplicationCrash Robot application exited abnormally. // SimulationApplicationCrash Simulation application exited abnormally. // BadPermissionsRobotApplication Robot application bundle could not be downloaded. // BadPermissionsSimulationApplication Simulation application bundle could not be // downloaded. BadPermissionsS3Output Unable to publish outputs to // customer-provided S3 bucket. BadPermissionsCloudwatchLogs Unable to publish logs // to customer-provided CloudWatch Logs resource. SubnetIpLimitExceeded Subnet IP // limit exceeded. ENILimitExceeded ENI limit exceeded. // BadPermissionsUserCredentials Unable to use the Role provided. // InvalidBundleRobotApplication Robot bundle cannot be extracted (invalid format, // bundling error, or other issue). InvalidBundleSimulationApplication Simulation // bundle cannot be extracted (invalid format, bundling error, or other issue). // RobotApplicationVersionMismatchedEtag Etag for RobotApplication does not match // value during version creation. SimulationApplicationVersionMismatchedEtag Etag // for SimulationApplication does not match value during version creation. FailureCode types.DeploymentJobErrorCode // The failure reason if the job fails. FailureReason *string // The Amazon Resource Name (ARN) of the fleet. Fleet *string // The status of the synchronization job. Status types.DeploymentStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSyncDeploymentJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpSyncDeploymentJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSyncDeploymentJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opSyncDeploymentJobMiddleware(stack, options); err != nil { return err } if err = addOpSyncDeploymentJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSyncDeploymentJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpSyncDeploymentJob struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpSyncDeploymentJob) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpSyncDeploymentJob) 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.(*SyncDeploymentJobInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *SyncDeploymentJobInput ") } 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_opSyncDeploymentJobMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpSyncDeploymentJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opSyncDeploymentJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "SyncDeploymentJob", } }
212
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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 or edits tags for a AWS RoboMaker resource. Each tag consists of a tag key // and a tag value. Tag keys and tag values are both required, but tag values can // be empty strings. For information about the rules that apply to tag keys and tag // values, see User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) // in the AWS Billing and Cost Management User Guide. 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 AWS RoboMaker resource you are tagging. // // This member is required. ResourceArn *string // A map that contains tag keys and tag values that are attached to the resource. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "TagResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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 tags from the specified AWS RoboMaker resource. To remove // a tag, specify the tag key. To change the tag value of an existing tag key, use // TagResource (https://docs.aws.amazon.com/robomaker/latest/dg/API_TagResource.html) // . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the AWS RoboMaker resource you are removing // tags. // // This member is required. ResourceArn *string // A map that contains tag keys and tag values that will be unattached from the // resource. // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "UntagResource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates a robot application. func (c *Client) UpdateRobotApplication(ctx context.Context, params *UpdateRobotApplicationInput, optFns ...func(*Options)) (*UpdateRobotApplicationOutput, error) { if params == nil { params = &UpdateRobotApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateRobotApplication", params, optFns, c.addOperationUpdateRobotApplicationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateRobotApplicationOutput) out.ResultMetadata = metadata return out, nil } type UpdateRobotApplicationInput struct { // The application information for the robot application. // // This member is required. Application *string // The robot software suite (ROS distribution) used by the robot application. // // This member is required. RobotSoftwareSuite *types.RobotSoftwareSuite // The revision id for the robot application. CurrentRevisionId *string // The object that contains the Docker image URI for your robot application. Environment *types.Environment // The sources of the robot application. Sources []types.SourceConfig noSmithyDocumentSerde } type UpdateRobotApplicationOutput struct { // The Amazon Resource Name (ARN) of the updated robot application. Arn *string // The object that contains the Docker image URI for your robot application. Environment *types.Environment // The time, in milliseconds since the epoch, when the robot application was last // updated. LastUpdatedAt *time.Time // The name of the robot application. Name *string // The revision id of the robot application. RevisionId *string // The robot software suite (ROS distribution) used by the robot application. RobotSoftwareSuite *types.RobotSoftwareSuite // The sources of the robot application. Sources []types.Source // The version of the robot application. Version *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateRobotApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRobotApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRobotApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateRobotApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRobotApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateRobotApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "UpdateRobotApplication", } }
162
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates a simulation application. func (c *Client) UpdateSimulationApplication(ctx context.Context, params *UpdateSimulationApplicationInput, optFns ...func(*Options)) (*UpdateSimulationApplicationOutput, error) { if params == nil { params = &UpdateSimulationApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSimulationApplication", params, optFns, c.addOperationUpdateSimulationApplicationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSimulationApplicationOutput) out.ResultMetadata = metadata return out, nil } type UpdateSimulationApplicationInput struct { // The application information for the simulation application. // // This member is required. Application *string // Information about the robot software suite (ROS distribution). // // This member is required. RobotSoftwareSuite *types.RobotSoftwareSuite // The simulation software suite used by the simulation application. // // This member is required. SimulationSoftwareSuite *types.SimulationSoftwareSuite // The revision id for the robot application. CurrentRevisionId *string // The object that contains the Docker image URI for your simulation application. Environment *types.Environment // The rendering engine for the simulation application. RenderingEngine *types.RenderingEngine // The sources of the simulation application. Sources []types.SourceConfig noSmithyDocumentSerde } type UpdateSimulationApplicationOutput struct { // The Amazon Resource Name (ARN) of the updated simulation application. Arn *string // The object that contains the Docker image URI used for your simulation // application. Environment *types.Environment // The time, in milliseconds since the epoch, when the simulation application was // last updated. LastUpdatedAt *time.Time // The name of the simulation application. Name *string // The rendering engine for the simulation application. RenderingEngine *types.RenderingEngine // The revision id of the simulation application. RevisionId *string // Information about the robot software suite (ROS distribution). RobotSoftwareSuite *types.RobotSoftwareSuite // The simulation software suite used by the simulation application. SimulationSoftwareSuite *types.SimulationSoftwareSuite // The sources of the simulation application. Sources []types.Source // The version of the robot application. Version *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSimulationApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSimulationApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSimulationApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateSimulationApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSimulationApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateSimulationApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "UpdateSimulationApplication", } }
177
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates a world template. func (c *Client) UpdateWorldTemplate(ctx context.Context, params *UpdateWorldTemplateInput, optFns ...func(*Options)) (*UpdateWorldTemplateOutput, error) { if params == nil { params = &UpdateWorldTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateWorldTemplate", params, optFns, c.addOperationUpdateWorldTemplateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateWorldTemplateOutput) out.ResultMetadata = metadata return out, nil } type UpdateWorldTemplateInput struct { // The Amazon Resource Name (arn) of the world template to update. // // This member is required. Template *string // The name of the template. Name *string // The world template body. TemplateBody *string // The location of the world template. TemplateLocation *types.TemplateLocation noSmithyDocumentSerde } type UpdateWorldTemplateOutput struct { // The Amazon Resource Name (arn) of the world template. Arn *string // The time, in milliseconds since the epoch, when the world template was created. CreatedAt *time.Time // The time, in milliseconds since the epoch, when the world template was last // updated. LastUpdatedAt *time.Time // The name of the world template. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateWorldTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorldTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorldTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateWorldTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorldTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateWorldTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "robomaker", OperationName: "UpdateWorldTemplate", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/robomaker/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 awsRestjson1_deserializeOpBatchDeleteWorlds struct { } func (*awsRestjson1_deserializeOpBatchDeleteWorlds) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchDeleteWorlds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorBatchDeleteWorlds(response, &metadata) } output := &BatchDeleteWorldsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentBatchDeleteWorldsOutput(&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_deserializeOpErrorBatchDeleteWorlds(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchDeleteWorldsOutput(v **BatchDeleteWorldsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchDeleteWorldsOutput if *v == nil { sv = &BatchDeleteWorldsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "unprocessedWorlds": if err := awsRestjson1_deserializeDocumentArns(&sv.UnprocessedWorlds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchDescribeSimulationJob struct { } func (*awsRestjson1_deserializeOpBatchDescribeSimulationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchDescribeSimulationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorBatchDescribeSimulationJob(response, &metadata) } output := &BatchDescribeSimulationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentBatchDescribeSimulationJobOutput(&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_deserializeOpErrorBatchDescribeSimulationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchDescribeSimulationJobOutput(v **BatchDescribeSimulationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchDescribeSimulationJobOutput if *v == nil { sv = &BatchDescribeSimulationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "jobs": if err := awsRestjson1_deserializeDocumentSimulationJobs(&sv.Jobs, value); err != nil { return err } case "unprocessedJobs": if err := awsRestjson1_deserializeDocumentArns(&sv.UnprocessedJobs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCancelDeploymentJob struct { } func (*awsRestjson1_deserializeOpCancelDeploymentJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelDeploymentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelDeploymentJob(response, &metadata) } output := &CancelDeploymentJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelDeploymentJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCancelSimulationJob struct { } func (*awsRestjson1_deserializeOpCancelSimulationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelSimulationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelSimulationJob(response, &metadata) } output := &CancelSimulationJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelSimulationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCancelSimulationJobBatch struct { } func (*awsRestjson1_deserializeOpCancelSimulationJobBatch) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelSimulationJobBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelSimulationJobBatch(response, &metadata) } output := &CancelSimulationJobBatchOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelSimulationJobBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCancelWorldExportJob struct { } func (*awsRestjson1_deserializeOpCancelWorldExportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelWorldExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelWorldExportJob(response, &metadata) } output := &CancelWorldExportJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelWorldExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCancelWorldGenerationJob struct { } func (*awsRestjson1_deserializeOpCancelWorldGenerationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelWorldGenerationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelWorldGenerationJob(response, &metadata) } output := &CancelWorldGenerationJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelWorldGenerationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCreateDeploymentJob struct { } func (*awsRestjson1_deserializeOpCreateDeploymentJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDeploymentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDeploymentJob(response, &metadata) } output := &CreateDeploymentJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateDeploymentJobOutput(&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_deserializeOpErrorCreateDeploymentJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConcurrentDeploymentException", errorCode): return awsRestjson1_deserializeErrorConcurrentDeploymentException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateDeploymentJobOutput(v **CreateDeploymentJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDeploymentJobOutput if *v == nil { sv = &CreateDeploymentJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "deploymentApplicationConfigs": if err := awsRestjson1_deserializeDocumentDeploymentApplicationConfigs(&sv.DeploymentApplicationConfigs, value); err != nil { return err } case "deploymentConfig": if err := awsRestjson1_deserializeDocumentDeploymentConfig(&sv.DeploymentConfig, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.DeploymentJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.Status = types.DeploymentStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFleet struct { } func (*awsRestjson1_deserializeOpCreateFleet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateFleet(response, &metadata) } output := &CreateFleetOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateFleetOutput(&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_deserializeOpErrorCreateFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateFleetOutput(v **CreateFleetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFleetOutput if *v == nil { sv = &CreateFleetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt 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 "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateRobot struct { } func (*awsRestjson1_deserializeOpCreateRobot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateRobot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateRobot(response, &metadata) } output := &CreateRobotOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateRobotOutput(&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_deserializeOpErrorCreateRobot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateRobotOutput(v **CreateRobotOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRobotOutput if *v == nil { sv = &CreateRobotOutput{} } else { sv = *v } for key, value := range shape { switch key { case "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) } sv.Architecture = types.Architecture(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "greengrassGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } sv.GreengrassGroupId = 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 "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateRobotApplication struct { } func (*awsRestjson1_deserializeOpCreateRobotApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateRobotApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateRobotApplication(response, &metadata) } output := &CreateRobotApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateRobotApplicationOutput(&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_deserializeOpErrorCreateRobotApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateRobotApplicationOutput(v **CreateRobotApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRobotApplicationOutput if *v == nil { sv = &CreateRobotApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpCreateRobotApplicationVersion struct { } func (*awsRestjson1_deserializeOpCreateRobotApplicationVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateRobotApplicationVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateRobotApplicationVersion(response, &metadata) } output := &CreateRobotApplicationVersionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateRobotApplicationVersionOutput(&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_deserializeOpErrorCreateRobotApplicationVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateRobotApplicationVersionOutput(v **CreateRobotApplicationVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRobotApplicationVersionOutput if *v == nil { sv = &CreateRobotApplicationVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpCreateSimulationApplication struct { } func (*awsRestjson1_deserializeOpCreateSimulationApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSimulationApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateSimulationApplication(response, &metadata) } output := &CreateSimulationApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateSimulationApplicationOutput(&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_deserializeOpErrorCreateSimulationApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateSimulationApplicationOutput(v **CreateSimulationApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateSimulationApplicationOutput if *v == nil { sv = &CreateSimulationApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "renderingEngine": if err := awsRestjson1_deserializeDocumentRenderingEngine(&sv.RenderingEngine, value); err != nil { return err } 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "simulationSoftwareSuite": if err := awsRestjson1_deserializeDocumentSimulationSoftwareSuite(&sv.SimulationSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpCreateSimulationApplicationVersion struct { } func (*awsRestjson1_deserializeOpCreateSimulationApplicationVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSimulationApplicationVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateSimulationApplicationVersion(response, &metadata) } output := &CreateSimulationApplicationVersionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateSimulationApplicationVersionOutput(&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_deserializeOpErrorCreateSimulationApplicationVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateSimulationApplicationVersionOutput(v **CreateSimulationApplicationVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateSimulationApplicationVersionOutput if *v == nil { sv = &CreateSimulationApplicationVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "renderingEngine": if err := awsRestjson1_deserializeDocumentRenderingEngine(&sv.RenderingEngine, value); err != nil { return err } 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "simulationSoftwareSuite": if err := awsRestjson1_deserializeDocumentSimulationSoftwareSuite(&sv.SimulationSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpCreateSimulationJob struct { } func (*awsRestjson1_deserializeOpCreateSimulationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSimulationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateSimulationJob(response, &metadata) } output := &CreateSimulationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateSimulationJobOutput(&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_deserializeOpErrorCreateSimulationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateSimulationJobOutput(v **CreateSimulationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateSimulationJobOutput if *v == nil { sv = &CreateSimulationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "compute": if err := awsRestjson1_deserializeDocumentComputeResponse(&sv.Compute, value); err != nil { return err } case "dataSources": if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { return err } case "failureBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureBehavior to be of type string, got %T instead", value) } sv.FailureBehavior = types.FailureBehavior(jtv) } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobErrorCode(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "lastStartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastStartedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "loggingConfig": if err := awsRestjson1_deserializeDocumentLoggingConfig(&sv.LoggingConfig, value); err != nil { return err } case "maxJobDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected JobDuration to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxJobDurationInSeconds = i64 } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "robotApplications": if err := awsRestjson1_deserializeDocumentRobotApplicationConfigs(&sv.RobotApplications, value); err != nil { return err } case "simulationApplications": if err := awsRestjson1_deserializeDocumentSimulationApplicationConfigs(&sv.SimulationApplications, value); err != nil { return err } case "simulationTimeMillis": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SimulationTimeMillis to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SimulationTimeMillis = i64 } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "vpcConfig": if err := awsRestjson1_deserializeDocumentVPCConfigResponse(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWorldExportJob struct { } func (*awsRestjson1_deserializeOpCreateWorldExportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWorldExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateWorldExportJob(response, &metadata) } output := &CreateWorldExportJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateWorldExportJobOutput(&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_deserializeOpErrorCreateWorldExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWorldExportJobOutput(v **CreateWorldExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateWorldExportJobOutput if *v == nil { sv = &CreateWorldExportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldExportJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.WorldExportJobErrorCode(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldExportJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldExportJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWorldGenerationJob struct { } func (*awsRestjson1_deserializeOpCreateWorldGenerationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWorldGenerationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateWorldGenerationJob(response, &metadata) } output := &CreateWorldGenerationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateWorldGenerationJobOutput(&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_deserializeOpErrorCreateWorldGenerationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWorldGenerationJobOutput(v **CreateWorldGenerationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateWorldGenerationJobOutput if *v == nil { sv = &CreateWorldGenerationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.WorldGenerationJobErrorCode(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldGenerationJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "template": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Template = ptr.String(jtv) } case "worldCount": if err := awsRestjson1_deserializeDocumentWorldCount(&sv.WorldCount, value); err != nil { return err } case "worldTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.WorldTags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWorldTemplate struct { } func (*awsRestjson1_deserializeOpCreateWorldTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWorldTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateWorldTemplate(response, &metadata) } output := &CreateWorldTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateWorldTemplateOutput(&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_deserializeOpErrorCreateWorldTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWorldTemplateOutput(v **CreateWorldTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateWorldTemplateOutput if *v == nil { sv = &CreateWorldTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteFleet struct { } func (*awsRestjson1_deserializeOpDeleteFleet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteFleet(response, &metadata) } output := &DeleteFleetOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteRobot struct { } func (*awsRestjson1_deserializeOpDeleteRobot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteRobot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteRobot(response, &metadata) } output := &DeleteRobotOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteRobot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteRobotApplication struct { } func (*awsRestjson1_deserializeOpDeleteRobotApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteRobotApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteRobotApplication(response, &metadata) } output := &DeleteRobotApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteRobotApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteSimulationApplication struct { } func (*awsRestjson1_deserializeOpDeleteSimulationApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteSimulationApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteSimulationApplication(response, &metadata) } output := &DeleteSimulationApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteSimulationApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteWorldTemplate struct { } func (*awsRestjson1_deserializeOpDeleteWorldTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteWorldTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteWorldTemplate(response, &metadata) } output := &DeleteWorldTemplateOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteWorldTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeregisterRobot struct { } func (*awsRestjson1_deserializeOpDeregisterRobot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeregisterRobot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeregisterRobot(response, &metadata) } output := &DeregisterRobotOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDeregisterRobotOutput(&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_deserializeOpErrorDeregisterRobot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeregisterRobotOutput(v **DeregisterRobotOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeregisterRobotOutput if *v == nil { sv = &DeregisterRobotOutput{} } else { sv = *v } for key, value := range shape { switch key { case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "robot": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Robot = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDeploymentJob struct { } func (*awsRestjson1_deserializeOpDescribeDeploymentJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDeploymentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeDeploymentJob(response, &metadata) } output := &DescribeDeploymentJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeDeploymentJobOutput(&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_deserializeOpErrorDescribeDeploymentJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDeploymentJobOutput(v **DescribeDeploymentJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDeploymentJobOutput if *v == nil { sv = &DescribeDeploymentJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "deploymentApplicationConfigs": if err := awsRestjson1_deserializeDocumentDeploymentApplicationConfigs(&sv.DeploymentApplicationConfigs, value); err != nil { return err } case "deploymentConfig": if err := awsRestjson1_deserializeDocumentDeploymentConfig(&sv.DeploymentConfig, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.DeploymentJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "robotDeploymentSummary": if err := awsRestjson1_deserializeDocumentRobotDeploymentSummary(&sv.RobotDeploymentSummary, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.Status = types.DeploymentStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeFleet struct { } func (*awsRestjson1_deserializeOpDescribeFleet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeFleet(response, &metadata) } output := &DescribeFleetOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeFleetOutput(&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_deserializeOpErrorDescribeFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeFleetOutput(v **DescribeFleetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeFleetOutput if *v == nil { sv = &DescribeFleetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "lastDeploymentJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LastDeploymentJob = ptr.String(jtv) } case "lastDeploymentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.LastDeploymentStatus = types.DeploymentStatus(jtv) } case "lastDeploymentTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastDeploymentTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt 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 "robots": if err := awsRestjson1_deserializeDocumentRobots(&sv.Robots, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeRobot struct { } func (*awsRestjson1_deserializeOpDescribeRobot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeRobot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeRobot(response, &metadata) } output := &DescribeRobotOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeRobotOutput(&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_deserializeOpErrorDescribeRobot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeRobotOutput(v **DescribeRobotOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeRobotOutput if *v == nil { sv = &DescribeRobotOutput{} } else { sv = *v } for key, value := range shape { switch key { case "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) } sv.Architecture = types.Architecture(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "fleetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.FleetArn = ptr.String(jtv) } case "greengrassGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } sv.GreengrassGroupId = ptr.String(jtv) } case "lastDeploymentJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LastDeploymentJob = ptr.String(jtv) } case "lastDeploymentTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastDeploymentTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt 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 "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RobotStatus to be of type string, got %T instead", value) } sv.Status = types.RobotStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeRobotApplication struct { } func (*awsRestjson1_deserializeOpDescribeRobotApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeRobotApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeRobotApplication(response, &metadata) } output := &DescribeRobotApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeRobotApplicationOutput(&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_deserializeOpErrorDescribeRobotApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeRobotApplicationOutput(v **DescribeRobotApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeRobotApplicationOutput if *v == nil { sv = &DescribeRobotApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "imageDigest": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value) } sv.ImageDigest = ptr.String(jtv) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpDescribeSimulationApplication struct { } func (*awsRestjson1_deserializeOpDescribeSimulationApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSimulationApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeSimulationApplication(response, &metadata) } output := &DescribeSimulationApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeSimulationApplicationOutput(&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_deserializeOpErrorDescribeSimulationApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSimulationApplicationOutput(v **DescribeSimulationApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSimulationApplicationOutput if *v == nil { sv = &DescribeSimulationApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "imageDigest": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value) } sv.ImageDigest = ptr.String(jtv) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "renderingEngine": if err := awsRestjson1_deserializeDocumentRenderingEngine(&sv.RenderingEngine, value); err != nil { return err } 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "simulationSoftwareSuite": if err := awsRestjson1_deserializeDocumentSimulationSoftwareSuite(&sv.SimulationSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpDescribeSimulationJob struct { } func (*awsRestjson1_deserializeOpDescribeSimulationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSimulationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeSimulationJob(response, &metadata) } output := &DescribeSimulationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeSimulationJobOutput(&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_deserializeOpErrorDescribeSimulationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSimulationJobOutput(v **DescribeSimulationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSimulationJobOutput if *v == nil { sv = &DescribeSimulationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "compute": if err := awsRestjson1_deserializeDocumentComputeResponse(&sv.Compute, value); err != nil { return err } case "dataSources": if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { return err } case "failureBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureBehavior to be of type string, got %T instead", value) } sv.FailureBehavior = types.FailureBehavior(jtv) } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "lastStartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastStartedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "loggingConfig": if err := awsRestjson1_deserializeDocumentLoggingConfig(&sv.LoggingConfig, value); err != nil { return err } case "maxJobDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected JobDuration to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxJobDurationInSeconds = 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) } case "networkInterface": if err := awsRestjson1_deserializeDocumentNetworkInterface(&sv.NetworkInterface, value); err != nil { return err } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "robotApplications": if err := awsRestjson1_deserializeDocumentRobotApplicationConfigs(&sv.RobotApplications, value); err != nil { return err } case "simulationApplications": if err := awsRestjson1_deserializeDocumentSimulationApplicationConfigs(&sv.SimulationApplications, value); err != nil { return err } case "simulationTimeMillis": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SimulationTimeMillis to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SimulationTimeMillis = i64 } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "vpcConfig": if err := awsRestjson1_deserializeDocumentVPCConfigResponse(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeSimulationJobBatch struct { } func (*awsRestjson1_deserializeOpDescribeSimulationJobBatch) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSimulationJobBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeSimulationJobBatch(response, &metadata) } output := &DescribeSimulationJobBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeSimulationJobBatchOutput(&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_deserializeOpErrorDescribeSimulationJobBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSimulationJobBatchOutput(v **DescribeSimulationJobBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSimulationJobBatchOutput if *v == nil { sv = &DescribeSimulationJobBatchOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "batchPolicy": if err := awsRestjson1_deserializeDocumentBatchPolicy(&sv.BatchPolicy, value); err != nil { return err } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "createdRequests": if err := awsRestjson1_deserializeDocumentSimulationJobSummaries(&sv.CreatedRequests, value); err != nil { return err } case "failedRequests": if err := awsRestjson1_deserializeDocumentFailedCreateSimulationJobRequests(&sv.FailedRequests, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobBatchErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobBatchErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "pendingRequests": if err := awsRestjson1_deserializeDocumentCreateSimulationJobRequests(&sv.PendingRequests, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobBatchStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobBatchStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeWorld struct { } func (*awsRestjson1_deserializeOpDescribeWorld) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeWorld) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeWorld(response, &metadata) } output := &DescribeWorldOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeWorldOutput(&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_deserializeOpErrorDescribeWorld(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeWorldOutput(v **DescribeWorldOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorldOutput if *v == nil { sv = &DescribeWorldOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "generationJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.GenerationJob = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "template": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Template = ptr.String(jtv) } case "worldDescriptionBody": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Json to be of type string, got %T instead", value) } sv.WorldDescriptionBody = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeWorldExportJob struct { } func (*awsRestjson1_deserializeOpDescribeWorldExportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeWorldExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeWorldExportJob(response, &metadata) } output := &DescribeWorldExportJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeWorldExportJobOutput(&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_deserializeOpErrorDescribeWorldExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeWorldExportJobOutput(v **DescribeWorldExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorldExportJobOutput if *v == nil { sv = &DescribeWorldExportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldExportJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.WorldExportJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldExportJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldExportJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "worlds": if err := awsRestjson1_deserializeDocumentArns(&sv.Worlds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeWorldGenerationJob struct { } func (*awsRestjson1_deserializeOpDescribeWorldGenerationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeWorldGenerationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeWorldGenerationJob(response, &metadata) } output := &DescribeWorldGenerationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeWorldGenerationJobOutput(&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_deserializeOpErrorDescribeWorldGenerationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeWorldGenerationJobOutput(v **DescribeWorldGenerationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorldGenerationJobOutput if *v == nil { sv = &DescribeWorldGenerationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.WorldGenerationJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "finishedWorldsSummary": if err := awsRestjson1_deserializeDocumentFinishedWorldsSummary(&sv.FinishedWorldsSummary, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldGenerationJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "template": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Template = ptr.String(jtv) } case "worldCount": if err := awsRestjson1_deserializeDocumentWorldCount(&sv.WorldCount, value); err != nil { return err } case "worldTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.WorldTags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeWorldTemplate struct { } func (*awsRestjson1_deserializeOpDescribeWorldTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeWorldTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeWorldTemplate(response, &metadata) } output := &DescribeWorldTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDescribeWorldTemplateOutput(&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_deserializeOpErrorDescribeWorldTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeWorldTemplateOutput(v **DescribeWorldTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeWorldTemplateOutput if *v == nil { sv = &DescribeWorldTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetWorldTemplateBody struct { } func (*awsRestjson1_deserializeOpGetWorldTemplateBody) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetWorldTemplateBody) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetWorldTemplateBody(response, &metadata) } output := &GetWorldTemplateBodyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentGetWorldTemplateBodyOutput(&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_deserializeOpErrorGetWorldTemplateBody(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetWorldTemplateBodyOutput(v **GetWorldTemplateBodyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetWorldTemplateBodyOutput if *v == nil { sv = &GetWorldTemplateBodyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "templateBody": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Json to be of type string, got %T instead", value) } sv.TemplateBody = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDeploymentJobs struct { } func (*awsRestjson1_deserializeOpListDeploymentJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDeploymentJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListDeploymentJobs(response, &metadata) } output := &ListDeploymentJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListDeploymentJobsOutput(&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_deserializeOpErrorListDeploymentJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDeploymentJobsOutput(v **ListDeploymentJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDeploymentJobsOutput if *v == nil { sv = &ListDeploymentJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deploymentJobs": if err := awsRestjson1_deserializeDocumentDeploymentJobs(&sv.DeploymentJobs, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFleets struct { } func (*awsRestjson1_deserializeOpListFleets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFleets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListFleets(response, &metadata) } output := &ListFleetsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListFleetsOutput(&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_deserializeOpErrorListFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListFleetsOutput(v **ListFleetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFleetsOutput if *v == nil { sv = &ListFleetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "fleetDetails": if err := awsRestjson1_deserializeDocumentFleets(&sv.FleetDetails, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListRobotApplications struct { } func (*awsRestjson1_deserializeOpListRobotApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListRobotApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListRobotApplications(response, &metadata) } output := &ListRobotApplicationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListRobotApplicationsOutput(&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_deserializeOpErrorListRobotApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListRobotApplicationsOutput(v **ListRobotApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRobotApplicationsOutput if *v == nil { sv = &ListRobotApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "robotApplicationSummaries": if err := awsRestjson1_deserializeDocumentRobotApplicationSummaries(&sv.RobotApplicationSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListRobots struct { } func (*awsRestjson1_deserializeOpListRobots) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListRobots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListRobots(response, &metadata) } output := &ListRobotsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListRobotsOutput(&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_deserializeOpErrorListRobots(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListRobotsOutput(v **ListRobotsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRobotsOutput if *v == nil { sv = &ListRobotsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "robots": if err := awsRestjson1_deserializeDocumentRobots(&sv.Robots, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSimulationApplications struct { } func (*awsRestjson1_deserializeOpListSimulationApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSimulationApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListSimulationApplications(response, &metadata) } output := &ListSimulationApplicationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListSimulationApplicationsOutput(&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_deserializeOpErrorListSimulationApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSimulationApplicationsOutput(v **ListSimulationApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSimulationApplicationsOutput if *v == nil { sv = &ListSimulationApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "simulationApplicationSummaries": if err := awsRestjson1_deserializeDocumentSimulationApplicationSummaries(&sv.SimulationApplicationSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSimulationJobBatches struct { } func (*awsRestjson1_deserializeOpListSimulationJobBatches) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSimulationJobBatches) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListSimulationJobBatches(response, &metadata) } output := &ListSimulationJobBatchesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListSimulationJobBatchesOutput(&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_deserializeOpErrorListSimulationJobBatches(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSimulationJobBatchesOutput(v **ListSimulationJobBatchesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSimulationJobBatchesOutput if *v == nil { sv = &ListSimulationJobBatchesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "simulationJobBatchSummaries": if err := awsRestjson1_deserializeDocumentSimulationJobBatchSummaries(&sv.SimulationJobBatchSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSimulationJobs struct { } func (*awsRestjson1_deserializeOpListSimulationJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSimulationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListSimulationJobs(response, &metadata) } output := &ListSimulationJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListSimulationJobsOutput(&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_deserializeOpErrorListSimulationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSimulationJobsOutput(v **ListSimulationJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSimulationJobsOutput if *v == nil { sv = &ListSimulationJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "simulationJobSummaries": if err := awsRestjson1_deserializeDocumentSimulationJobSummaries(&sv.SimulationJobSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(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_deserializeOpListWorldExportJobs struct { } func (*awsRestjson1_deserializeOpListWorldExportJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorldExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListWorldExportJobs(response, &metadata) } output := &ListWorldExportJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListWorldExportJobsOutput(&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_deserializeOpErrorListWorldExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorldExportJobsOutput(v **ListWorldExportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorldExportJobsOutput if *v == nil { sv = &ListWorldExportJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "worldExportJobSummaries": if err := awsRestjson1_deserializeDocumentWorldExportJobSummaries(&sv.WorldExportJobSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorldGenerationJobs struct { } func (*awsRestjson1_deserializeOpListWorldGenerationJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorldGenerationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListWorldGenerationJobs(response, &metadata) } output := &ListWorldGenerationJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListWorldGenerationJobsOutput(&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_deserializeOpErrorListWorldGenerationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorldGenerationJobsOutput(v **ListWorldGenerationJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorldGenerationJobsOutput if *v == nil { sv = &ListWorldGenerationJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "worldGenerationJobSummaries": if err := awsRestjson1_deserializeDocumentWorldGenerationJobSummaries(&sv.WorldGenerationJobSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorlds struct { } func (*awsRestjson1_deserializeOpListWorlds) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorlds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListWorlds(response, &metadata) } output := &ListWorldsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListWorldsOutput(&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_deserializeOpErrorListWorlds(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorldsOutput(v **ListWorldsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorldsOutput if *v == nil { sv = &ListWorldsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "worldSummaries": if err := awsRestjson1_deserializeDocumentWorldSummaries(&sv.WorldSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorldTemplates struct { } func (*awsRestjson1_deserializeOpListWorldTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorldTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListWorldTemplates(response, &metadata) } output := &ListWorldTemplatesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListWorldTemplatesOutput(&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_deserializeOpErrorListWorldTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorldTemplatesOutput(v **ListWorldTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWorldTemplatesOutput if *v == nil { sv = &ListWorldTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "templateSummaries": if err := awsRestjson1_deserializeDocumentTemplateSummaries(&sv.TemplateSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRegisterRobot struct { } func (*awsRestjson1_deserializeOpRegisterRobot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRegisterRobot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorRegisterRobot(response, &metadata) } output := &RegisterRobotOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentRegisterRobotOutput(&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_deserializeOpErrorRegisterRobot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentRegisterRobotOutput(v **RegisterRobotOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RegisterRobotOutput if *v == nil { sv = &RegisterRobotOutput{} } else { sv = *v } for key, value := range shape { switch key { case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "robot": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Robot = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRestartSimulationJob struct { } func (*awsRestjson1_deserializeOpRestartSimulationJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRestartSimulationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorRestartSimulationJob(response, &metadata) } output := &RestartSimulationJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRestartSimulationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStartSimulationJobBatch struct { } func (*awsRestjson1_deserializeOpStartSimulationJobBatch) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartSimulationJobBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartSimulationJobBatch(response, &metadata) } output := &StartSimulationJobBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentStartSimulationJobBatchOutput(&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_deserializeOpErrorStartSimulationJobBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartSimulationJobBatchOutput(v **StartSimulationJobBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartSimulationJobBatchOutput if *v == nil { sv = &StartSimulationJobBatchOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "batchPolicy": if err := awsRestjson1_deserializeDocumentBatchPolicy(&sv.BatchPolicy, value); err != nil { return err } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "createdRequests": if err := awsRestjson1_deserializeDocumentSimulationJobSummaries(&sv.CreatedRequests, value); err != nil { return err } case "failedRequests": if err := awsRestjson1_deserializeDocumentFailedCreateSimulationJobRequests(&sv.FailedRequests, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobBatchErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobBatchErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "pendingRequests": if err := awsRestjson1_deserializeDocumentCreateSimulationJobRequests(&sv.PendingRequests, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobBatchStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobBatchStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSyncDeploymentJob struct { } func (*awsRestjson1_deserializeOpSyncDeploymentJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSyncDeploymentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorSyncDeploymentJob(response, &metadata) } output := &SyncDeploymentJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentSyncDeploymentJobOutput(&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_deserializeOpErrorSyncDeploymentJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConcurrentDeploymentException", errorCode): return awsRestjson1_deserializeErrorConcurrentDeploymentException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentSyncDeploymentJobOutput(v **SyncDeploymentJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SyncDeploymentJobOutput if *v == nil { sv = &SyncDeploymentJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "deploymentApplicationConfigs": if err := awsRestjson1_deserializeDocumentDeploymentApplicationConfigs(&sv.DeploymentApplicationConfigs, value); err != nil { return err } case "deploymentConfig": if err := awsRestjson1_deserializeDocumentDeploymentConfig(&sv.DeploymentConfig, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.DeploymentJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.Status = types.DeploymentStatus(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateRobotApplication struct { } func (*awsRestjson1_deserializeOpUpdateRobotApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateRobotApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateRobotApplication(response, &metadata) } output := &UpdateRobotApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentUpdateRobotApplicationOutput(&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_deserializeOpErrorUpdateRobotApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateRobotApplicationOutput(v **UpdateRobotApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateRobotApplicationOutput if *v == nil { sv = &UpdateRobotApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpUpdateSimulationApplication struct { } func (*awsRestjson1_deserializeOpUpdateSimulationApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSimulationApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateSimulationApplication(response, &metadata) } output := &UpdateSimulationApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentUpdateSimulationApplicationOutput(&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_deserializeOpErrorUpdateSimulationApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateSimulationApplicationOutput(v **UpdateSimulationApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateSimulationApplicationOutput if *v == nil { sv = &UpdateSimulationApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "renderingEngine": if err := awsRestjson1_deserializeDocumentRenderingEngine(&sv.RenderingEngine, value); err != nil { return err } 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "simulationSoftwareSuite": if err := awsRestjson1_deserializeDocumentSimulationSoftwareSuite(&sv.SimulationSoftwareSuite, value); err != nil { return err } case "sources": if err := awsRestjson1_deserializeDocumentSources(&sv.Sources, value); err != nil { return err } 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 } type awsRestjson1_deserializeOpUpdateWorldTemplate struct { } func (*awsRestjson1_deserializeOpUpdateWorldTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateWorldTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateWorldTemplate(response, &metadata) } output := &UpdateWorldTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentUpdateWorldTemplateOutput(&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_deserializeOpErrorUpdateWorldTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateWorldTemplateOutput(v **UpdateWorldTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateWorldTemplateOutput if *v == nil { sv = &UpdateWorldTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorConcurrentDeploymentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConcurrentDeploymentException{} 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_deserializeDocumentConcurrentDeploymentException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, 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_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.IdempotentParameterMismatchException{} 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_deserializeDocumentIdempotentParameterMismatchException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidParameterException{} 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_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 awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceAlreadyExistsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} 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_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func 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_deserializeDocumentArns(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchPolicy(v **types.BatchPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BatchPolicy if *v == nil { sv = &types.BatchPolicy{} } else { sv = *v } for key, value := range shape { switch key { 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 = ptr.Int32(int32(i64)) } case "timeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BatchTimeoutInSeconds 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 awsRestjson1_deserializeDocumentCommandList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCompute(v **types.Compute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Compute if *v == nil { sv = &types.Compute{} } else { sv = *v } for key, value := range shape { switch key { case "computeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComputeType to be of type string, got %T instead", value) } sv.ComputeType = types.ComputeType(jtv) } case "gpuUnitLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GPUUnit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.GpuUnitLimit = ptr.Int32(int32(i64)) } case "simulationUnitLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SimulationUnit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SimulationUnitLimit = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComputeResponse(v **types.ComputeResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ComputeResponse if *v == nil { sv = &types.ComputeResponse{} } else { sv = *v } for key, value := range shape { switch key { case "computeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComputeType to be of type string, got %T instead", value) } sv.ComputeType = types.ComputeType(jtv) } case "gpuUnitLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GPUUnit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.GpuUnitLimit = ptr.Int32(int32(i64)) } case "simulationUnitLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SimulationUnit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SimulationUnitLimit = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConcurrentDeploymentException(v **types.ConcurrentDeploymentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConcurrentDeploymentException if *v == nil { sv = &types.ConcurrentDeploymentException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCreateSimulationJobRequests(v *[]types.SimulationJobRequest, 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.SimulationJobRequest if *v == nil { cv = []types.SimulationJobRequest{} } else { cv = *v } for _, value := range shape { var col types.SimulationJobRequest destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationJobRequest(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSource if *v == nil { sv = &types.DataSource{} } else { sv = *v } for key, value := range shape { switch key { case "destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Path to be of type string, got %T instead", value) } sv.Destination = 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 "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3Keys": if err := awsRestjson1_deserializeDocumentS3KeyOutputs(&sv.S3Keys, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) } sv.Type = types.DataSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSourceConfig(v **types.DataSourceConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSourceConfig if *v == nil { sv = &types.DataSourceConfig{} } else { sv = *v } for key, value := range shape { switch key { case "destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Path to be of type string, got %T instead", value) } sv.Destination = 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 "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3Keys": if err := awsRestjson1_deserializeDocumentS3KeysOrPrefixes(&sv.S3Keys, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) } sv.Type = types.DataSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSourceConfigs(v *[]types.DataSourceConfig, 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.DataSourceConfig if *v == nil { cv = []types.DataSourceConfig{} } else { cv = *v } for _, value := range shape { var col types.DataSourceConfig destAddr := &col if err := awsRestjson1_deserializeDocumentDataSourceConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSourceNames(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 Name to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSources(v *[]types.DataSource, 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.DataSource if *v == nil { cv = []types.DataSource{} } else { cv = *v } for _, value := range shape { var col types.DataSource destAddr := &col if err := awsRestjson1_deserializeDocumentDataSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDeploymentApplicationConfig(v **types.DeploymentApplicationConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeploymentApplicationConfig if *v == nil { sv = &types.DeploymentApplicationConfig{} } else { sv = *v } for key, value := range shape { switch key { case "application": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Application = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentVersion to be of type string, got %T instead", value) } sv.ApplicationVersion = ptr.String(jtv) } case "launchConfig": if err := awsRestjson1_deserializeDocumentDeploymentLaunchConfig(&sv.LaunchConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeploymentApplicationConfigs(v *[]types.DeploymentApplicationConfig, 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.DeploymentApplicationConfig if *v == nil { cv = []types.DeploymentApplicationConfig{} } else { cv = *v } for _, value := range shape { var col types.DeploymentApplicationConfig destAddr := &col if err := awsRestjson1_deserializeDocumentDeploymentApplicationConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDeploymentConfig(v **types.DeploymentConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeploymentConfig if *v == nil { sv = &types.DeploymentConfig{} } else { sv = *v } for key, value := range shape { switch key { case "concurrentDeploymentPercentage": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ConcurrentDeploymentPercentage = ptr.Int32(int32(i64)) } case "downloadConditionFile": if err := awsRestjson1_deserializeDocumentS3Object(&sv.DownloadConditionFile, value); err != nil { return err } case "failureThresholdPercentage": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.FailureThresholdPercentage = ptr.Int32(int32(i64)) } case "robotDeploymentTimeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected DeploymentTimeout to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RobotDeploymentTimeoutInSeconds = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeploymentJob(v **types.DeploymentJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeploymentJob if *v == nil { sv = &types.DeploymentJob{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "deploymentApplicationConfigs": if err := awsRestjson1_deserializeDocumentDeploymentApplicationConfigs(&sv.DeploymentApplicationConfigs, value); err != nil { return err } case "deploymentConfig": if err := awsRestjson1_deserializeDocumentDeploymentConfig(&sv.DeploymentConfig, value); err != nil { return err } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.DeploymentJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "fleet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Fleet = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.Status = types.DeploymentStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeploymentJobs(v *[]types.DeploymentJob, 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.DeploymentJob if *v == nil { cv = []types.DeploymentJob{} } else { cv = *v } for _, value := range shape { var col types.DeploymentJob destAddr := &col if err := awsRestjson1_deserializeDocumentDeploymentJob(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDeploymentLaunchConfig(v **types.DeploymentLaunchConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeploymentLaunchConfig if *v == nil { sv = &types.DeploymentLaunchConfig{} } else { sv = *v } for key, value := range shape { switch key { case "environmentVariables": if err := awsRestjson1_deserializeDocumentEnvironmentVariableMap(&sv.EnvironmentVariables, value); err != nil { return err } case "launchFile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Command to be of type string, got %T instead", value) } sv.LaunchFile = ptr.String(jtv) } case "packageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Command to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "postLaunchFile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Path to be of type string, got %T instead", value) } sv.PostLaunchFile = ptr.String(jtv) } case "preLaunchFile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Path to be of type string, got %T instead", value) } sv.PreLaunchFile = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEnvironment(v **types.Environment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Environment if *v == nil { sv = &types.Environment{} } else { sv = *v } for key, value := range shape { switch key { case "uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RepositoryUrl to be of type string, got %T instead", value) } sv.Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEnvironmentVariableMap(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 EnvironmentVariableValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentFailedCreateSimulationJobRequest(v **types.FailedCreateSimulationJobRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailedCreateSimulationJobRequest if *v == nil { sv = &types.FailedCreateSimulationJobRequest{} } else { sv = *v } for key, value := range shape { switch key { case "failedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FailedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected FailedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "request": if err := awsRestjson1_deserializeDocumentSimulationJobRequest(&sv.Request, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFailedCreateSimulationJobRequests(v *[]types.FailedCreateSimulationJobRequest, 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.FailedCreateSimulationJobRequest if *v == nil { cv = []types.FailedCreateSimulationJobRequest{} } else { cv = *v } for _, value := range shape { var col types.FailedCreateSimulationJobRequest destAddr := &col if err := awsRestjson1_deserializeDocumentFailedCreateSimulationJobRequest(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFailureSummary(v **types.FailureSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailureSummary if *v == nil { sv = &types.FailureSummary{} } else { sv = *v } for key, value := range shape { switch key { case "failures": if err := awsRestjson1_deserializeDocumentWorldFailures(&sv.Failures, value); err != nil { return err } case "totalFailureCount": 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.TotalFailureCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFinishedWorldsSummary(v **types.FinishedWorldsSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FinishedWorldsSummary if *v == nil { sv = &types.FinishedWorldsSummary{} } else { sv = *v } for key, value := range shape { switch key { case "failureSummary": if err := awsRestjson1_deserializeDocumentFailureSummary(&sv.FailureSummary, value); err != nil { return err } case "finishedCount": 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.FinishedCount = int32(i64) } case "succeededWorlds": if err := awsRestjson1_deserializeDocumentArns(&sv.SucceededWorlds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFleet(v **types.Fleet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Fleet if *v == nil { sv = &types.Fleet{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "lastDeploymentJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LastDeploymentJob = ptr.String(jtv) } case "lastDeploymentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.LastDeploymentStatus = types.DeploymentStatus(jtv) } case "lastDeploymentTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastDeploymentTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt 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 awsRestjson1_deserializeDocumentFleets(v *[]types.Fleet, 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.Fleet if *v == nil { cv = []types.Fleet{} } else { cv = *v } for _, value := range shape { var col types.Fleet destAddr := &col if err := awsRestjson1_deserializeDocumentFleet(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IdempotentParameterMismatchException if *v == nil { sv = &types.IdempotentParameterMismatchException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 "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_deserializeDocumentLaunchConfig(v **types.LaunchConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LaunchConfig if *v == nil { sv = &types.LaunchConfig{} } else { sv = *v } for key, value := range shape { switch key { case "command": if err := awsRestjson1_deserializeDocumentCommandList(&sv.Command, value); err != nil { return err } case "environmentVariables": if err := awsRestjson1_deserializeDocumentEnvironmentVariableMap(&sv.EnvironmentVariables, value); err != nil { return err } case "launchFile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Command to be of type string, got %T instead", value) } sv.LaunchFile = ptr.String(jtv) } case "packageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Command to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "portForwardingConfig": if err := awsRestjson1_deserializeDocumentPortForwardingConfig(&sv.PortForwardingConfig, value); err != nil { return err } case "streamUI": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StreamUI = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLoggingConfig(v **types.LoggingConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LoggingConfig if *v == nil { sv = &types.LoggingConfig{} } else { sv = *v } for key, value := range shape { switch key { case "recordAllRosTopics": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.RecordAllRosTopics = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkInterface if *v == nil { sv = &types.NetworkInterface{} } else { sv = *v } for key, value := range shape { switch key { case "networkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "privateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } case "publicIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.PublicIpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOutputLocation(v **types.OutputLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.OutputLocation if *v == nil { sv = &types.OutputLocation{} } else { sv = *v } for key, value := range shape { switch key { case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortForwardingConfig(v **types.PortForwardingConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortForwardingConfig if *v == nil { sv = &types.PortForwardingConfig{} } else { sv = *v } for key, value := range shape { switch key { case "portMappings": if err := awsRestjson1_deserializeDocumentPortMappingList(&sv.PortMappings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortMapping(v **types.PortMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortMapping if *v == nil { sv = &types.PortMapping{} } else { sv = *v } for key, value := range shape { switch key { case "applicationPort": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NonSystemPort to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationPort = int32(i64) } case "enableOnPublicIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableOnPublicIp = jtv } case "jobPort": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.JobPort = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortMappingList(v *[]types.PortMapping, 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.PortMapping if *v == nil { cv = []types.PortMapping{} } else { cv = *v } for _, value := range shape { var col types.PortMapping destAddr := &col if err := awsRestjson1_deserializeDocumentPortMapping(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProgressDetail(v **types.ProgressDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProgressDetail if *v == nil { sv = &types.ProgressDetail{} } else { sv = *v } for key, value := range shape { switch key { case "currentProgress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RobotDeploymentStep to be of type string, got %T instead", value) } sv.CurrentProgress = types.RobotDeploymentStep(jtv) } case "estimatedTimeRemainingSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GenericInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EstimatedTimeRemainingSeconds = ptr.Int32(int32(i64)) } case "percentDone": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PercentDone = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.PercentDone = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected PercentDone to be a JSON Number, got %T instead", value) } } case "targetResource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.TargetResource = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRenderingEngine(v **types.RenderingEngine, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RenderingEngine if *v == nil { sv = &types.RenderingEngine{} } 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 RenderingEngineType to be of type string, got %T instead", value) } sv.Name = types.RenderingEngineType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RenderingEngineVersionType to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceAlreadyExistsException if *v == nil { sv = &types.ResourceAlreadyExistsException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRobot(v **types.Robot, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Robot if *v == nil { sv = &types.Robot{} } else { sv = *v } for key, value := range shape { switch key { case "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) } sv.Architecture = types.Architecture(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "fleetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.FleetArn = ptr.String(jtv) } case "greenGrassGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } sv.GreenGrassGroupId = ptr.String(jtv) } case "lastDeploymentJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.LastDeploymentJob = ptr.String(jtv) } case "lastDeploymentTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastDeploymentTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt 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 "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RobotStatus to be of type string, got %T instead", value) } sv.Status = types.RobotStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRobotApplicationConfig(v **types.RobotApplicationConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RobotApplicationConfig if *v == nil { sv = &types.RobotApplicationConfig{} } else { sv = *v } for key, value := range shape { switch key { case "application": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Application = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Version to be of type string, got %T instead", value) } sv.ApplicationVersion = ptr.String(jtv) } case "launchConfig": if err := awsRestjson1_deserializeDocumentLaunchConfig(&sv.LaunchConfig, value); err != nil { return err } case "tools": if err := awsRestjson1_deserializeDocumentTools(&sv.Tools, value); err != nil { return err } case "uploadConfigurations": if err := awsRestjson1_deserializeDocumentUploadConfigurations(&sv.UploadConfigurations, value); err != nil { return err } case "useDefaultTools": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.UseDefaultTools = ptr.Bool(jtv) } case "useDefaultUploadConfigurations": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.UseDefaultUploadConfigurations = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRobotApplicationConfigs(v *[]types.RobotApplicationConfig, 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.RobotApplicationConfig if *v == nil { cv = []types.RobotApplicationConfig{} } else { cv = *v } for _, value := range shape { var col types.RobotApplicationConfig destAddr := &col if err := awsRestjson1_deserializeDocumentRobotApplicationConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRobotApplicationNames(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 Name to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRobotApplicationSummaries(v *[]types.RobotApplicationSummary, 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.RobotApplicationSummary if *v == nil { cv = []types.RobotApplicationSummary{} } else { cv = *v } for _, value := range shape { var col types.RobotApplicationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentRobotApplicationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRobotApplicationSummary(v **types.RobotApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RobotApplicationSummary if *v == nil { sv = &types.RobotApplicationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } 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_deserializeDocumentRobotDeployment(v **types.RobotDeployment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RobotDeployment if *v == nil { sv = &types.RobotDeployment{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "deploymentFinishTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeploymentFinishTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "deploymentStartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeploymentStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.DeploymentJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "progressDetail": if err := awsRestjson1_deserializeDocumentProgressDetail(&sv.ProgressDetail, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RobotStatus to be of type string, got %T instead", value) } sv.Status = types.RobotStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRobotDeploymentSummary(v *[]types.RobotDeployment, 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.RobotDeployment if *v == nil { cv = []types.RobotDeployment{} } else { cv = *v } for _, value := range shape { var col types.RobotDeployment destAddr := &col if err := awsRestjson1_deserializeDocumentRobotDeployment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRobots(v *[]types.Robot, 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.Robot if *v == nil { cv = []types.Robot{} } else { cv = *v } for _, value := range shape { var col types.Robot destAddr := &col if err := awsRestjson1_deserializeDocumentRobot(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRobotSoftwareSuite(v **types.RobotSoftwareSuite, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RobotSoftwareSuite if *v == nil { sv = &types.RobotSoftwareSuite{} } 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 RobotSoftwareSuiteType to be of type string, got %T instead", value) } sv.Name = types.RobotSoftwareSuiteType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RobotSoftwareSuiteVersionType to be of type string, got %T instead", value) } sv.Version = types.RobotSoftwareSuiteVersionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3KeyOutput(v **types.S3KeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3KeyOutput if *v == nil { sv = &types.S3KeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "etag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Etag to be of type string, got %T instead", value) } sv.Etag = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3KeyOrPrefix to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3KeyOutputs(v *[]types.S3KeyOutput, 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.S3KeyOutput if *v == nil { cv = []types.S3KeyOutput{} } else { cv = *v } for _, value := range shape { var col types.S3KeyOutput destAddr := &col if err := awsRestjson1_deserializeDocumentS3KeyOutput(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentS3KeysOrPrefixes(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 S3KeyOrPrefix to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentS3Object(v **types.S3Object, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3Object if *v == nil { sv = &types.S3Object{} } else { sv = *v } for key, value := range shape { switch key { case "bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "etag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Etag to be of type string, got %T instead", value) } sv.Etag = ptr.String(jtv) } case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroups(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationApplicationConfig(v **types.SimulationApplicationConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationApplicationConfig if *v == nil { sv = &types.SimulationApplicationConfig{} } else { sv = *v } for key, value := range shape { switch key { case "application": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Application = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Version to be of type string, got %T instead", value) } sv.ApplicationVersion = ptr.String(jtv) } case "launchConfig": if err := awsRestjson1_deserializeDocumentLaunchConfig(&sv.LaunchConfig, value); err != nil { return err } case "tools": if err := awsRestjson1_deserializeDocumentTools(&sv.Tools, value); err != nil { return err } case "uploadConfigurations": if err := awsRestjson1_deserializeDocumentUploadConfigurations(&sv.UploadConfigurations, value); err != nil { return err } case "useDefaultTools": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.UseDefaultTools = ptr.Bool(jtv) } case "useDefaultUploadConfigurations": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.UseDefaultUploadConfigurations = ptr.Bool(jtv) } case "worldConfigs": if err := awsRestjson1_deserializeDocumentWorldConfigs(&sv.WorldConfigs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationApplicationConfigs(v *[]types.SimulationApplicationConfig, 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.SimulationApplicationConfig if *v == nil { cv = []types.SimulationApplicationConfig{} } else { cv = *v } for _, value := range shape { var col types.SimulationApplicationConfig destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationApplicationConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationApplicationNames(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 Name to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationApplicationSummaries(v *[]types.SimulationApplicationSummary, 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.SimulationApplicationSummary if *v == nil { cv = []types.SimulationApplicationSummary{} } else { cv = *v } for _, value := range shape { var col types.SimulationApplicationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationApplicationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationApplicationSummary(v **types.SimulationApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationApplicationSummary if *v == nil { sv = &types.SimulationApplicationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "robotSoftwareSuite": if err := awsRestjson1_deserializeDocumentRobotSoftwareSuite(&sv.RobotSoftwareSuite, value); err != nil { return err } case "simulationSoftwareSuite": if err := awsRestjson1_deserializeDocumentSimulationSoftwareSuite(&sv.SimulationSoftwareSuite, value); err != nil { return err } 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_deserializeDocumentSimulationJob(v **types.SimulationJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationJob if *v == nil { sv = &types.SimulationJob{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "clientRequestToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientRequestToken to be of type string, got %T instead", value) } sv.ClientRequestToken = ptr.String(jtv) } case "compute": if err := awsRestjson1_deserializeDocumentComputeResponse(&sv.Compute, value); err != nil { return err } case "dataSources": if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { return err } case "failureBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureBehavior to be of type string, got %T instead", value) } sv.FailureBehavior = types.FailureBehavior(jtv) } case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.SimulationJobErrorCode(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "lastStartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastStartedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "loggingConfig": if err := awsRestjson1_deserializeDocumentLoggingConfig(&sv.LoggingConfig, value); err != nil { return err } case "maxJobDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected JobDuration to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxJobDurationInSeconds = 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) } case "networkInterface": if err := awsRestjson1_deserializeDocumentNetworkInterface(&sv.NetworkInterface, value); err != nil { return err } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "robotApplications": if err := awsRestjson1_deserializeDocumentRobotApplicationConfigs(&sv.RobotApplications, value); err != nil { return err } case "simulationApplications": if err := awsRestjson1_deserializeDocumentSimulationApplicationConfigs(&sv.SimulationApplications, value); err != nil { return err } case "simulationTimeMillis": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SimulationTimeMillis to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SimulationTimeMillis = i64 } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "vpcConfig": if err := awsRestjson1_deserializeDocumentVPCConfigResponse(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationJobBatchSummaries(v *[]types.SimulationJobBatchSummary, 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.SimulationJobBatchSummary if *v == nil { cv = []types.SimulationJobBatchSummary{} } else { cv = *v } for _, value := range shape { var col types.SimulationJobBatchSummary destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationJobBatchSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationJobBatchSummary(v **types.SimulationJobBatchSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationJobBatchSummary if *v == nil { sv = &types.SimulationJobBatchSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "createdRequestCount": 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.CreatedRequestCount = int32(i64) } case "failedRequestCount": 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.FailedRequestCount = int32(i64) } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "pendingRequestCount": 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.PendingRequestCount = int32(i64) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobBatchStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobBatchStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationJobRequest(v **types.SimulationJobRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationJobRequest if *v == nil { sv = &types.SimulationJobRequest{} } else { sv = *v } for key, value := range shape { switch key { case "compute": if err := awsRestjson1_deserializeDocumentCompute(&sv.Compute, value); err != nil { return err } case "dataSources": if err := awsRestjson1_deserializeDocumentDataSourceConfigs(&sv.DataSources, value); err != nil { return err } case "failureBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureBehavior to be of type string, got %T instead", value) } sv.FailureBehavior = types.FailureBehavior(jtv) } case "iamRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRole to be of type string, got %T instead", value) } sv.IamRole = ptr.String(jtv) } case "loggingConfig": if err := awsRestjson1_deserializeDocumentLoggingConfig(&sv.LoggingConfig, value); err != nil { return err } case "maxJobDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected JobDuration to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxJobDurationInSeconds = i64 } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "robotApplications": if err := awsRestjson1_deserializeDocumentRobotApplicationConfigs(&sv.RobotApplications, value); err != nil { return err } case "simulationApplications": if err := awsRestjson1_deserializeDocumentSimulationApplicationConfigs(&sv.SimulationApplications, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "useDefaultApplications": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.UseDefaultApplications = ptr.Bool(jtv) } case "vpcConfig": if err := awsRestjson1_deserializeDocumentVPCConfig(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationJobs(v *[]types.SimulationJob, 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.SimulationJob if *v == nil { cv = []types.SimulationJob{} } else { cv = *v } for _, value := range shape { var col types.SimulationJob destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationJob(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationJobSummaries(v *[]types.SimulationJobSummary, 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.SimulationJobSummary if *v == nil { cv = []types.SimulationJobSummary{} } else { cv = *v } for _, value := range shape { var col types.SimulationJobSummary destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationJobSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationJobSummary(v **types.SimulationJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationJobSummary if *v == nil { sv = &types.SimulationJobSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "computeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComputeType to be of type string, got %T instead", value) } sv.ComputeType = types.ComputeType(jtv) } case "dataSourceNames": if err := awsRestjson1_deserializeDocumentDataSourceNames(&sv.DataSourceNames, value); err != nil { return err } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt 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 "robotApplicationNames": if err := awsRestjson1_deserializeDocumentRobotApplicationNames(&sv.RobotApplicationNames, value); err != nil { return err } case "simulationApplicationNames": if err := awsRestjson1_deserializeDocumentSimulationApplicationNames(&sv.SimulationApplicationNames, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationJobStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationJobStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationSoftwareSuite(v **types.SimulationSoftwareSuite, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SimulationSoftwareSuite if *v == nil { sv = &types.SimulationSoftwareSuite{} } 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 SimulationSoftwareSuiteType to be of type string, got %T instead", value) } sv.Name = types.SimulationSoftwareSuiteType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationSoftwareSuiteVersionType to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv 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 "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) } sv.Architecture = types.Architecture(jtv) } case "etag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Etag to be of type string, got %T instead", value) } sv.Etag = ptr.String(jtv) } case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSources(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.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Source if *v == nil { cv = []types.Source{} } else { cv = *v } for _, value := range shape { var col types.Source destAddr := &col if err := awsRestjson1_deserializeDocumentSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnets(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func 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_deserializeDocumentTemplateSummaries(v *[]types.TemplateSummary, 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.TemplateSummary if *v == nil { cv = []types.TemplateSummary{} } else { cv = *v } for _, value := range shape { var col types.TemplateSummary destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTemplateSummary(v **types.TemplateSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TemplateSummary if *v == nil { sv = &types.TemplateSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "lastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdatedAt to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTool(v **types.Tool, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tool if *v == nil { sv = &types.Tool{} } else { sv = *v } for key, value := range shape { switch key { case "command": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnrestrictedCommand to be of type string, got %T instead", value) } sv.Command = ptr.String(jtv) } case "exitBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExitBehavior to be of type string, got %T instead", value) } sv.ExitBehavior = types.ExitBehavior(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 "streamOutputToCloudWatch": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.StreamOutputToCloudWatch = ptr.Bool(jtv) } case "streamUI": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) } sv.StreamUI = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTools(v *[]types.Tool, 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.Tool if *v == nil { cv = []types.Tool{} } else { cv = *v } for _, value := range shape { var col types.Tool destAddr := &col if err := awsRestjson1_deserializeDocumentTool(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUploadConfiguration(v **types.UploadConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UploadConfiguration if *v == nil { sv = &types.UploadConfiguration{} } 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 "path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Path to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "uploadBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UploadBehavior to be of type string, got %T instead", value) } sv.UploadBehavior = types.UploadBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUploadConfigurations(v *[]types.UploadConfiguration, 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.UploadConfiguration if *v == nil { cv = []types.UploadConfiguration{} } else { cv = *v } for _, value := range shape { var col types.UploadConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentUploadConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVPCConfig(v **types.VPCConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VPCConfig if *v == nil { sv = &types.VPCConfig{} } else { sv = *v } for key, value := range shape { switch key { case "assignPublicIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssignPublicIp = jtv } case "securityGroups": if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { return err } case "subnets": if err := awsRestjson1_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCConfigResponse(v **types.VPCConfigResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VPCConfigResponse if *v == nil { sv = &types.VPCConfigResponse{} } else { sv = *v } for key, value := range shape { switch key { case "assignPublicIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssignPublicIp = jtv } case "securityGroups": if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { return err } case "subnets": if err := awsRestjson1_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { return err } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldConfig(v **types.WorldConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldConfig if *v == nil { sv = &types.WorldConfig{} } else { sv = *v } for key, value := range shape { switch key { case "world": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.World = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldConfigs(v *[]types.WorldConfig, 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.WorldConfig if *v == nil { cv = []types.WorldConfig{} } else { cv = *v } for _, value := range shape { var col types.WorldConfig destAddr := &col if err := awsRestjson1_deserializeDocumentWorldConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorldCount(v **types.WorldCount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldCount if *v == nil { sv = &types.WorldCount{} } else { sv = *v } for key, value := range shape { switch key { case "floorplanCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected FloorplanCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.FloorplanCount = ptr.Int32(int32(i64)) } case "interiorCountPerFloorplan": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected InteriorCountPerFloorplan to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InteriorCountPerFloorplan = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldExportJobSummaries(v *[]types.WorldExportJobSummary, 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.WorldExportJobSummary if *v == nil { cv = []types.WorldExportJobSummary{} } else { cv = *v } for _, value := range shape { var col types.WorldExportJobSummary destAddr := &col if err := awsRestjson1_deserializeDocumentWorldExportJobSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorldExportJobSummary(v **types.WorldExportJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldExportJobSummary if *v == nil { sv = &types.WorldExportJobSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "outputLocation": if err := awsRestjson1_deserializeDocumentOutputLocation(&sv.OutputLocation, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldExportJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldExportJobStatus(jtv) } case "worlds": if err := awsRestjson1_deserializeDocumentArns(&sv.Worlds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldFailure(v **types.WorldFailure, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldFailure if *v == nil { sv = &types.WorldFailure{} } else { sv = *v } for key, value := range shape { switch key { case "failureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobErrorCode to be of type string, got %T instead", value) } sv.FailureCode = types.WorldGenerationJobErrorCode(jtv) } case "failureCount": 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.FailureCount = int32(i64) } case "sampleFailureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } sv.SampleFailureReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldFailures(v *[]types.WorldFailure, 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.WorldFailure if *v == nil { cv = []types.WorldFailure{} } else { cv = *v } for _, value := range shape { var col types.WorldFailure destAddr := &col if err := awsRestjson1_deserializeDocumentWorldFailure(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorldGenerationJobSummaries(v *[]types.WorldGenerationJobSummary, 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.WorldGenerationJobSummary if *v == nil { cv = []types.WorldGenerationJobSummary{} } else { cv = *v } for _, value := range shape { var col types.WorldGenerationJobSummary destAddr := &col if err := awsRestjson1_deserializeDocumentWorldGenerationJobSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorldGenerationJobSummary(v **types.WorldGenerationJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldGenerationJobSummary if *v == nil { sv = &types.WorldGenerationJobSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "failedWorldCount": 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.FailedWorldCount = int32(i64) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorldGenerationJobStatus to be of type string, got %T instead", value) } sv.Status = types.WorldGenerationJobStatus(jtv) } case "succeededWorldCount": 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.SucceededWorldCount = int32(i64) } case "template": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Template = ptr.String(jtv) } case "worldCount": if err := awsRestjson1_deserializeDocumentWorldCount(&sv.WorldCount, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorldSummaries(v *[]types.WorldSummary, 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.WorldSummary if *v == nil { cv = []types.WorldSummary{} } else { cv = *v } for _, value := range shape { var col types.WorldSummary destAddr := &col if err := awsRestjson1_deserializeDocumentWorldSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorldSummary(v **types.WorldSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorldSummary if *v == nil { sv = &types.WorldSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "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 CreatedAt to be a JSON Number, got %T instead", value) } } case "generationJob": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.GenerationJob = ptr.String(jtv) } case "template": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Template = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
15,793
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package robomaker provides the API client, operations, and parameter types for // AWS RoboMaker. // // This section provides documentation for the AWS RoboMaker API operations. package robomaker
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker 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/robomaker/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 = "robomaker" } 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 robomaker // 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 robomaker
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpBatchDeleteWorlds struct { } func (*awsRestjson1_serializeOpBatchDeleteWorlds) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchDeleteWorlds) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*BatchDeleteWorldsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/batchDeleteWorlds") 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_serializeOpDocumentBatchDeleteWorldsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchDeleteWorldsInput(v *BatchDeleteWorldsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentBatchDeleteWorldsInput(v *BatchDeleteWorldsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Worlds != nil { ok := object.Key("worlds") if err := awsRestjson1_serializeDocumentArns(v.Worlds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpBatchDescribeSimulationJob struct { } func (*awsRestjson1_serializeOpBatchDescribeSimulationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchDescribeSimulationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*BatchDescribeSimulationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/batchDescribeSimulationJob") 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_serializeOpDocumentBatchDescribeSimulationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchDescribeSimulationJobInput(v *BatchDescribeSimulationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentBatchDescribeSimulationJobInput(v *BatchDescribeSimulationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Jobs != nil { ok := object.Key("jobs") if err := awsRestjson1_serializeDocumentArns(v.Jobs, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCancelDeploymentJob struct { } func (*awsRestjson1_serializeOpCancelDeploymentJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelDeploymentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelDeploymentJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cancelDeploymentJob") 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_serializeOpDocumentCancelDeploymentJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCancelDeploymentJobInput(v *CancelDeploymentJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelDeploymentJobInput(v *CancelDeploymentJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpCancelSimulationJob struct { } func (*awsRestjson1_serializeOpCancelSimulationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelSimulationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelSimulationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cancelSimulationJob") 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_serializeOpDocumentCancelSimulationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCancelSimulationJobInput(v *CancelSimulationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelSimulationJobInput(v *CancelSimulationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpCancelSimulationJobBatch struct { } func (*awsRestjson1_serializeOpCancelSimulationJobBatch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelSimulationJobBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelSimulationJobBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cancelSimulationJobBatch") 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_serializeOpDocumentCancelSimulationJobBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCancelSimulationJobBatchInput(v *CancelSimulationJobBatchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelSimulationJobBatchInput(v *CancelSimulationJobBatchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Batch != nil { ok := object.Key("batch") ok.String(*v.Batch) } return nil } type awsRestjson1_serializeOpCancelWorldExportJob struct { } func (*awsRestjson1_serializeOpCancelWorldExportJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelWorldExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelWorldExportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cancelWorldExportJob") 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_serializeOpDocumentCancelWorldExportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCancelWorldExportJobInput(v *CancelWorldExportJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelWorldExportJobInput(v *CancelWorldExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpCancelWorldGenerationJob struct { } func (*awsRestjson1_serializeOpCancelWorldGenerationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelWorldGenerationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelWorldGenerationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cancelWorldGenerationJob") 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_serializeOpDocumentCancelWorldGenerationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCancelWorldGenerationJobInput(v *CancelWorldGenerationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelWorldGenerationJobInput(v *CancelWorldGenerationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpCreateDeploymentJob struct { } func (*awsRestjson1_serializeOpCreateDeploymentJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateDeploymentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDeploymentJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createDeploymentJob") 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_serializeOpDocumentCreateDeploymentJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDeploymentJobInput(v *CreateDeploymentJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateDeploymentJobInput(v *CreateDeploymentJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.DeploymentApplicationConfigs != nil { ok := object.Key("deploymentApplicationConfigs") if err := awsRestjson1_serializeDocumentDeploymentApplicationConfigs(v.DeploymentApplicationConfigs, ok); err != nil { return err } } if v.DeploymentConfig != nil { ok := object.Key("deploymentConfig") if err := awsRestjson1_serializeDocumentDeploymentConfig(v.DeploymentConfig, ok); err != nil { return err } } if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateFleet struct { } func (*awsRestjson1_serializeOpCreateFleet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateFleetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createFleet") 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_serializeOpDocumentCreateFleetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateFleetInput(v *CreateFleetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateRobot struct { } func (*awsRestjson1_serializeOpCreateRobot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateRobot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateRobotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createRobot") 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_serializeOpDocumentCreateRobotInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateRobotInput(v *CreateRobotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateRobotInput(v *CreateRobotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Architecture) > 0 { ok := object.Key("architecture") ok.String(string(v.Architecture)) } if v.GreengrassGroupId != nil { ok := object.Key("greengrassGroupId") ok.String(*v.GreengrassGroupId) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateRobotApplication struct { } func (*awsRestjson1_serializeOpCreateRobotApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateRobotApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateRobotApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createRobotApplication") 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_serializeOpDocumentCreateRobotApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateRobotApplicationInput(v *CreateRobotApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateRobotApplicationInput(v *CreateRobotApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Environment != nil { ok := object.Key("environment") if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RobotSoftwareSuite != nil { ok := object.Key("robotSoftwareSuite") if err := awsRestjson1_serializeDocumentRobotSoftwareSuite(v.RobotSoftwareSuite, ok); err != nil { return err } } if v.Sources != nil { ok := object.Key("sources") if err := awsRestjson1_serializeDocumentSourceConfigs(v.Sources, 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_serializeOpCreateRobotApplicationVersion struct { } func (*awsRestjson1_serializeOpCreateRobotApplicationVersion) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateRobotApplicationVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateRobotApplicationVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createRobotApplicationVersion") 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_serializeOpDocumentCreateRobotApplicationVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateRobotApplicationVersionInput(v *CreateRobotApplicationVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateRobotApplicationVersionInput(v *CreateRobotApplicationVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.CurrentRevisionId != nil { ok := object.Key("currentRevisionId") ok.String(*v.CurrentRevisionId) } if v.ImageDigest != nil { ok := object.Key("imageDigest") ok.String(*v.ImageDigest) } if v.S3Etags != nil { ok := object.Key("s3Etags") if err := awsRestjson1_serializeDocumentS3Etags(v.S3Etags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateSimulationApplication struct { } func (*awsRestjson1_serializeOpCreateSimulationApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSimulationApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSimulationApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createSimulationApplication") 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_serializeOpDocumentCreateSimulationApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateSimulationApplicationInput(v *CreateSimulationApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSimulationApplicationInput(v *CreateSimulationApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Environment != nil { ok := object.Key("environment") if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RenderingEngine != nil { ok := object.Key("renderingEngine") if err := awsRestjson1_serializeDocumentRenderingEngine(v.RenderingEngine, ok); err != nil { return err } } if v.RobotSoftwareSuite != nil { ok := object.Key("robotSoftwareSuite") if err := awsRestjson1_serializeDocumentRobotSoftwareSuite(v.RobotSoftwareSuite, ok); err != nil { return err } } if v.SimulationSoftwareSuite != nil { ok := object.Key("simulationSoftwareSuite") if err := awsRestjson1_serializeDocumentSimulationSoftwareSuite(v.SimulationSoftwareSuite, ok); err != nil { return err } } if v.Sources != nil { ok := object.Key("sources") if err := awsRestjson1_serializeDocumentSourceConfigs(v.Sources, 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_serializeOpCreateSimulationApplicationVersion struct { } func (*awsRestjson1_serializeOpCreateSimulationApplicationVersion) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSimulationApplicationVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSimulationApplicationVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createSimulationApplicationVersion") 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_serializeOpDocumentCreateSimulationApplicationVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateSimulationApplicationVersionInput(v *CreateSimulationApplicationVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSimulationApplicationVersionInput(v *CreateSimulationApplicationVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.CurrentRevisionId != nil { ok := object.Key("currentRevisionId") ok.String(*v.CurrentRevisionId) } if v.ImageDigest != nil { ok := object.Key("imageDigest") ok.String(*v.ImageDigest) } if v.S3Etags != nil { ok := object.Key("s3Etags") if err := awsRestjson1_serializeDocumentS3Etags(v.S3Etags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateSimulationJob struct { } func (*awsRestjson1_serializeOpCreateSimulationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSimulationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSimulationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createSimulationJob") 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_serializeOpDocumentCreateSimulationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateSimulationJobInput(v *CreateSimulationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSimulationJobInput(v *CreateSimulationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.Compute != nil { ok := object.Key("compute") if err := awsRestjson1_serializeDocumentCompute(v.Compute, ok); err != nil { return err } } if v.DataSources != nil { ok := object.Key("dataSources") if err := awsRestjson1_serializeDocumentDataSourceConfigs(v.DataSources, ok); err != nil { return err } } if len(v.FailureBehavior) > 0 { ok := object.Key("failureBehavior") ok.String(string(v.FailureBehavior)) } if v.IamRole != nil { ok := object.Key("iamRole") ok.String(*v.IamRole) } if v.LoggingConfig != nil { ok := object.Key("loggingConfig") if err := awsRestjson1_serializeDocumentLoggingConfig(v.LoggingConfig, ok); err != nil { return err } } { ok := object.Key("maxJobDurationInSeconds") ok.Long(v.MaxJobDurationInSeconds) } if v.OutputLocation != nil { ok := object.Key("outputLocation") if err := awsRestjson1_serializeDocumentOutputLocation(v.OutputLocation, ok); err != nil { return err } } if v.RobotApplications != nil { ok := object.Key("robotApplications") if err := awsRestjson1_serializeDocumentRobotApplicationConfigs(v.RobotApplications, ok); err != nil { return err } } if v.SimulationApplications != nil { ok := object.Key("simulationApplications") if err := awsRestjson1_serializeDocumentSimulationApplicationConfigs(v.SimulationApplications, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.VpcConfig != nil { ok := object.Key("vpcConfig") if err := awsRestjson1_serializeDocumentVPCConfig(v.VpcConfig, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateWorldExportJob struct { } func (*awsRestjson1_serializeOpCreateWorldExportJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWorldExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateWorldExportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createWorldExportJob") 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_serializeOpDocumentCreateWorldExportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWorldExportJobInput(v *CreateWorldExportJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateWorldExportJobInput(v *CreateWorldExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.IamRole != nil { ok := object.Key("iamRole") ok.String(*v.IamRole) } if v.OutputLocation != nil { ok := object.Key("outputLocation") if err := awsRestjson1_serializeDocumentOutputLocation(v.OutputLocation, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.Worlds != nil { ok := object.Key("worlds") if err := awsRestjson1_serializeDocumentArns(v.Worlds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateWorldGenerationJob struct { } func (*awsRestjson1_serializeOpCreateWorldGenerationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWorldGenerationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateWorldGenerationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createWorldGenerationJob") 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_serializeOpDocumentCreateWorldGenerationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWorldGenerationJobInput(v *CreateWorldGenerationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateWorldGenerationJobInput(v *CreateWorldGenerationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.Template != nil { ok := object.Key("template") ok.String(*v.Template) } if v.WorldCount != nil { ok := object.Key("worldCount") if err := awsRestjson1_serializeDocumentWorldCount(v.WorldCount, ok); err != nil { return err } } if v.WorldTags != nil { ok := object.Key("worldTags") if err := awsRestjson1_serializeDocumentTagMap(v.WorldTags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateWorldTemplate struct { } func (*awsRestjson1_serializeOpCreateWorldTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWorldTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateWorldTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createWorldTemplate") 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_serializeOpDocumentCreateWorldTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWorldTemplateInput(v *CreateWorldTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateWorldTemplateInput(v *CreateWorldTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.TemplateBody != nil { ok := object.Key("templateBody") ok.String(*v.TemplateBody) } if v.TemplateLocation != nil { ok := object.Key("templateLocation") if err := awsRestjson1_serializeDocumentTemplateLocation(v.TemplateLocation, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteFleet struct { } func (*awsRestjson1_serializeOpDeleteFleet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteFleetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteFleet") 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_serializeOpDocumentDeleteFleetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteFleetInput(v *DeleteFleetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteFleetInput(v *DeleteFleetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } return nil } type awsRestjson1_serializeOpDeleteRobot struct { } func (*awsRestjson1_serializeOpDeleteRobot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteRobot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteRobotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteRobot") 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_serializeOpDocumentDeleteRobotInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteRobotInput(v *DeleteRobotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteRobotInput(v *DeleteRobotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Robot != nil { ok := object.Key("robot") ok.String(*v.Robot) } return nil } type awsRestjson1_serializeOpDeleteRobotApplication struct { } func (*awsRestjson1_serializeOpDeleteRobotApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteRobotApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteRobotApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteRobotApplication") 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_serializeOpDocumentDeleteRobotApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteRobotApplicationInput(v *DeleteRobotApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteRobotApplicationInput(v *DeleteRobotApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } return nil } type awsRestjson1_serializeOpDeleteSimulationApplication struct { } func (*awsRestjson1_serializeOpDeleteSimulationApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteSimulationApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteSimulationApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteSimulationApplication") 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_serializeOpDocumentDeleteSimulationApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteSimulationApplicationInput(v *DeleteSimulationApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteSimulationApplicationInput(v *DeleteSimulationApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } return nil } type awsRestjson1_serializeOpDeleteWorldTemplate struct { } func (*awsRestjson1_serializeOpDeleteWorldTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteWorldTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteWorldTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteWorldTemplate") 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_serializeOpDocumentDeleteWorldTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteWorldTemplateInput(v *DeleteWorldTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteWorldTemplateInput(v *DeleteWorldTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Template != nil { ok := object.Key("template") ok.String(*v.Template) } return nil } type awsRestjson1_serializeOpDeregisterRobot struct { } func (*awsRestjson1_serializeOpDeregisterRobot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeregisterRobot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeregisterRobotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deregisterRobot") 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_serializeOpDocumentDeregisterRobotInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeregisterRobotInput(v *DeregisterRobotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeregisterRobotInput(v *DeregisterRobotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } if v.Robot != nil { ok := object.Key("robot") ok.String(*v.Robot) } return nil } type awsRestjson1_serializeOpDescribeDeploymentJob struct { } func (*awsRestjson1_serializeOpDescribeDeploymentJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDeploymentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeDeploymentJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeDeploymentJob") 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_serializeOpDocumentDescribeDeploymentJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeDeploymentJobInput(v *DescribeDeploymentJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeDeploymentJobInput(v *DescribeDeploymentJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpDescribeFleet struct { } func (*awsRestjson1_serializeOpDescribeFleet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeFleetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeFleet") 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_serializeOpDocumentDescribeFleetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeFleetInput(v *DescribeFleetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeFleetInput(v *DescribeFleetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } return nil } type awsRestjson1_serializeOpDescribeRobot struct { } func (*awsRestjson1_serializeOpDescribeRobot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeRobot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeRobotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeRobot") 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_serializeOpDocumentDescribeRobotInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeRobotInput(v *DescribeRobotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeRobotInput(v *DescribeRobotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Robot != nil { ok := object.Key("robot") ok.String(*v.Robot) } return nil } type awsRestjson1_serializeOpDescribeRobotApplication struct { } func (*awsRestjson1_serializeOpDescribeRobotApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeRobotApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeRobotApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeRobotApplication") 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_serializeOpDocumentDescribeRobotApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeRobotApplicationInput(v *DescribeRobotApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeRobotApplicationInput(v *DescribeRobotApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } return nil } type awsRestjson1_serializeOpDescribeSimulationApplication struct { } func (*awsRestjson1_serializeOpDescribeSimulationApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSimulationApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSimulationApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeSimulationApplication") 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_serializeOpDocumentDescribeSimulationApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeSimulationApplicationInput(v *DescribeSimulationApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeSimulationApplicationInput(v *DescribeSimulationApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } return nil } type awsRestjson1_serializeOpDescribeSimulationJob struct { } func (*awsRestjson1_serializeOpDescribeSimulationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSimulationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSimulationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeSimulationJob") 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_serializeOpDocumentDescribeSimulationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeSimulationJobInput(v *DescribeSimulationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeSimulationJobInput(v *DescribeSimulationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpDescribeSimulationJobBatch struct { } func (*awsRestjson1_serializeOpDescribeSimulationJobBatch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSimulationJobBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSimulationJobBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeSimulationJobBatch") 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_serializeOpDocumentDescribeSimulationJobBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeSimulationJobBatchInput(v *DescribeSimulationJobBatchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeSimulationJobBatchInput(v *DescribeSimulationJobBatchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Batch != nil { ok := object.Key("batch") ok.String(*v.Batch) } return nil } type awsRestjson1_serializeOpDescribeWorld struct { } func (*awsRestjson1_serializeOpDescribeWorld) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeWorld) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorldInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeWorld") 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_serializeOpDocumentDescribeWorldInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeWorldInput(v *DescribeWorldInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeWorldInput(v *DescribeWorldInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.World != nil { ok := object.Key("world") ok.String(*v.World) } return nil } type awsRestjson1_serializeOpDescribeWorldExportJob struct { } func (*awsRestjson1_serializeOpDescribeWorldExportJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeWorldExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorldExportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeWorldExportJob") 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_serializeOpDocumentDescribeWorldExportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeWorldExportJobInput(v *DescribeWorldExportJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeWorldExportJobInput(v *DescribeWorldExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpDescribeWorldGenerationJob struct { } func (*awsRestjson1_serializeOpDescribeWorldGenerationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeWorldGenerationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorldGenerationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeWorldGenerationJob") 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_serializeOpDocumentDescribeWorldGenerationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeWorldGenerationJobInput(v *DescribeWorldGenerationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeWorldGenerationJobInput(v *DescribeWorldGenerationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpDescribeWorldTemplate struct { } func (*awsRestjson1_serializeOpDescribeWorldTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeWorldTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeWorldTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeWorldTemplate") 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_serializeOpDocumentDescribeWorldTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDescribeWorldTemplateInput(v *DescribeWorldTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeWorldTemplateInput(v *DescribeWorldTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Template != nil { ok := object.Key("template") ok.String(*v.Template) } return nil } type awsRestjson1_serializeOpGetWorldTemplateBody struct { } func (*awsRestjson1_serializeOpGetWorldTemplateBody) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetWorldTemplateBody) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetWorldTemplateBodyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getWorldTemplateBody") 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_serializeOpDocumentGetWorldTemplateBodyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsGetWorldTemplateBodyInput(v *GetWorldTemplateBodyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetWorldTemplateBodyInput(v *GetWorldTemplateBodyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GenerationJob != nil { ok := object.Key("generationJob") ok.String(*v.GenerationJob) } if v.Template != nil { ok := object.Key("template") ok.String(*v.Template) } return nil } type awsRestjson1_serializeOpListDeploymentJobs struct { } func (*awsRestjson1_serializeOpListDeploymentJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDeploymentJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDeploymentJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listDeploymentJobs") 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_serializeOpDocumentListDeploymentJobsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListDeploymentJobsInput(v *ListDeploymentJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListDeploymentJobsInput(v *ListDeploymentJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListFleets struct { } func (*awsRestjson1_serializeOpListFleets) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListFleetsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listFleets") 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_serializeOpDocumentListFleetsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListFleetsInput(v *ListFleetsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListFleetsInput(v *ListFleetsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListRobotApplications struct { } func (*awsRestjson1_serializeOpListRobotApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListRobotApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListRobotApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listRobotApplications") 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_serializeOpDocumentListRobotApplicationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListRobotApplicationsInput(v *ListRobotApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListRobotApplicationsInput(v *ListRobotApplicationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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.VersionQualifier != nil { ok := object.Key("versionQualifier") ok.String(*v.VersionQualifier) } return nil } type awsRestjson1_serializeOpListRobots struct { } func (*awsRestjson1_serializeOpListRobots) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListRobots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListRobotsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listRobots") 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_serializeOpDocumentListRobotsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListRobotsInput(v *ListRobotsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListRobotsInput(v *ListRobotsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListSimulationApplications struct { } func (*awsRestjson1_serializeOpListSimulationApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSimulationApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSimulationApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listSimulationApplications") 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_serializeOpDocumentListSimulationApplicationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListSimulationApplicationsInput(v *ListSimulationApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListSimulationApplicationsInput(v *ListSimulationApplicationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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.VersionQualifier != nil { ok := object.Key("versionQualifier") ok.String(*v.VersionQualifier) } return nil } type awsRestjson1_serializeOpListSimulationJobBatches struct { } func (*awsRestjson1_serializeOpListSimulationJobBatches) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSimulationJobBatches) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSimulationJobBatchesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listSimulationJobBatches") 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_serializeOpDocumentListSimulationJobBatchesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListSimulationJobBatchesInput(v *ListSimulationJobBatchesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListSimulationJobBatchesInput(v *ListSimulationJobBatchesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListSimulationJobs struct { } func (*awsRestjson1_serializeOpListSimulationJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSimulationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSimulationJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listSimulationJobs") 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_serializeOpDocumentListSimulationJobsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListSimulationJobsInput(v *ListSimulationJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListSimulationJobsInput(v *ListSimulationJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } 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_serializeOpListWorldExportJobs struct { } func (*awsRestjson1_serializeOpListWorldExportJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWorldExportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorldExportJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listWorldExportJobs") 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_serializeOpDocumentListWorldExportJobsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListWorldExportJobsInput(v *ListWorldExportJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListWorldExportJobsInput(v *ListWorldExportJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListWorldGenerationJobs struct { } func (*awsRestjson1_serializeOpListWorldGenerationJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWorldGenerationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorldGenerationJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listWorldGenerationJobs") 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_serializeOpDocumentListWorldGenerationJobsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListWorldGenerationJobsInput(v *ListWorldGenerationJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListWorldGenerationJobsInput(v *ListWorldGenerationJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListWorlds struct { } func (*awsRestjson1_serializeOpListWorlds) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWorlds) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorldsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listWorlds") 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_serializeOpDocumentListWorldsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListWorldsInput(v *ListWorldsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListWorldsInput(v *ListWorldsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilters(v.Filters, 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 } type awsRestjson1_serializeOpListWorldTemplates struct { } func (*awsRestjson1_serializeOpListWorldTemplates) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWorldTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListWorldTemplatesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listWorldTemplates") 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_serializeOpDocumentListWorldTemplatesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListWorldTemplatesInput(v *ListWorldTemplatesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListWorldTemplatesInput(v *ListWorldTemplatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpRegisterRobot struct { } func (*awsRestjson1_serializeOpRegisterRobot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRegisterRobot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterRobotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/registerRobot") 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_serializeOpDocumentRegisterRobotInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsRegisterRobotInput(v *RegisterRobotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRegisterRobotInput(v *RegisterRobotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } if v.Robot != nil { ok := object.Key("robot") ok.String(*v.Robot) } return nil } type awsRestjson1_serializeOpRestartSimulationJob struct { } func (*awsRestjson1_serializeOpRestartSimulationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRestartSimulationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RestartSimulationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/restartSimulationJob") 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_serializeOpDocumentRestartSimulationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsRestartSimulationJobInput(v *RestartSimulationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRestartSimulationJobInput(v *RestartSimulationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Job != nil { ok := object.Key("job") ok.String(*v.Job) } return nil } type awsRestjson1_serializeOpStartSimulationJobBatch struct { } func (*awsRestjson1_serializeOpStartSimulationJobBatch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartSimulationJobBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartSimulationJobBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/startSimulationJobBatch") 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_serializeOpDocumentStartSimulationJobBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartSimulationJobBatchInput(v *StartSimulationJobBatchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartSimulationJobBatchInput(v *StartSimulationJobBatchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchPolicy != nil { ok := object.Key("batchPolicy") if err := awsRestjson1_serializeDocumentBatchPolicy(v.BatchPolicy, ok); err != nil { return err } } if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.CreateSimulationJobRequests != nil { ok := object.Key("createSimulationJobRequests") if err := awsRestjson1_serializeDocumentCreateSimulationJobRequests(v.CreateSimulationJobRequests, 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_serializeOpSyncDeploymentJob struct { } func (*awsRestjson1_serializeOpSyncDeploymentJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpSyncDeploymentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*SyncDeploymentJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/syncDeploymentJob") 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_serializeOpDocumentSyncDeploymentJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSyncDeploymentJobInput(v *SyncDeploymentJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentSyncDeploymentJobInput(v *SyncDeploymentJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("clientRequestToken") ok.String(*v.ClientRequestToken) } if v.Fleet != nil { ok := object.Key("fleet") ok.String(*v.Fleet) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateRobotApplication struct { } func (*awsRestjson1_serializeOpUpdateRobotApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateRobotApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateRobotApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/updateRobotApplication") 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_serializeOpDocumentUpdateRobotApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateRobotApplicationInput(v *UpdateRobotApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateRobotApplicationInput(v *UpdateRobotApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.CurrentRevisionId != nil { ok := object.Key("currentRevisionId") ok.String(*v.CurrentRevisionId) } if v.Environment != nil { ok := object.Key("environment") if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil { return err } } if v.RobotSoftwareSuite != nil { ok := object.Key("robotSoftwareSuite") if err := awsRestjson1_serializeDocumentRobotSoftwareSuite(v.RobotSoftwareSuite, ok); err != nil { return err } } if v.Sources != nil { ok := object.Key("sources") if err := awsRestjson1_serializeDocumentSourceConfigs(v.Sources, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateSimulationApplication struct { } func (*awsRestjson1_serializeOpUpdateSimulationApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateSimulationApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateSimulationApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/updateSimulationApplication") 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_serializeOpDocumentUpdateSimulationApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateSimulationApplicationInput(v *UpdateSimulationApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateSimulationApplicationInput(v *UpdateSimulationApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.CurrentRevisionId != nil { ok := object.Key("currentRevisionId") ok.String(*v.CurrentRevisionId) } if v.Environment != nil { ok := object.Key("environment") if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil { return err } } if v.RenderingEngine != nil { ok := object.Key("renderingEngine") if err := awsRestjson1_serializeDocumentRenderingEngine(v.RenderingEngine, ok); err != nil { return err } } if v.RobotSoftwareSuite != nil { ok := object.Key("robotSoftwareSuite") if err := awsRestjson1_serializeDocumentRobotSoftwareSuite(v.RobotSoftwareSuite, ok); err != nil { return err } } if v.SimulationSoftwareSuite != nil { ok := object.Key("simulationSoftwareSuite") if err := awsRestjson1_serializeDocumentSimulationSoftwareSuite(v.SimulationSoftwareSuite, ok); err != nil { return err } } if v.Sources != nil { ok := object.Key("sources") if err := awsRestjson1_serializeDocumentSourceConfigs(v.Sources, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateWorldTemplate struct { } func (*awsRestjson1_serializeOpUpdateWorldTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateWorldTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateWorldTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/updateWorldTemplate") 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_serializeOpDocumentUpdateWorldTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateWorldTemplateInput(v *UpdateWorldTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateWorldTemplateInput(v *UpdateWorldTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Template != nil { ok := object.Key("template") ok.String(*v.Template) } if v.TemplateBody != nil { ok := object.Key("templateBody") ok.String(*v.TemplateBody) } if v.TemplateLocation != nil { ok := object.Key("templateLocation") if err := awsRestjson1_serializeDocumentTemplateLocation(v.TemplateLocation, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentArns(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentBatchPolicy(v *types.BatchPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxConcurrency != nil { ok := object.Key("maxConcurrency") ok.Integer(*v.MaxConcurrency) } if v.TimeoutInSeconds != nil { ok := object.Key("timeoutInSeconds") ok.Long(*v.TimeoutInSeconds) } return nil } func awsRestjson1_serializeDocumentCommandList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentCompute(v *types.Compute, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ComputeType) > 0 { ok := object.Key("computeType") ok.String(string(v.ComputeType)) } if v.GpuUnitLimit != nil { ok := object.Key("gpuUnitLimit") ok.Integer(*v.GpuUnitLimit) } if v.SimulationUnitLimit != nil { ok := object.Key("simulationUnitLimit") ok.Integer(*v.SimulationUnitLimit) } return nil } func awsRestjson1_serializeDocumentCreateSimulationJobRequests(v []types.SimulationJobRequest, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSimulationJobRequest(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDataSourceConfig(v *types.DataSourceConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Destination != nil { ok := object.Key("destination") ok.String(*v.Destination) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3Keys != nil { ok := object.Key("s3Keys") if err := awsRestjson1_serializeDocumentS3KeysOrPrefixes(v.S3Keys, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsRestjson1_serializeDocumentDataSourceConfigs(v []types.DataSourceConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentDataSourceConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDeploymentApplicationConfig(v *types.DeploymentApplicationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } if v.LaunchConfig != nil { ok := object.Key("launchConfig") if err := awsRestjson1_serializeDocumentDeploymentLaunchConfig(v.LaunchConfig, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDeploymentApplicationConfigs(v []types.DeploymentApplicationConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentDeploymentApplicationConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDeploymentConfig(v *types.DeploymentConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConcurrentDeploymentPercentage != nil { ok := object.Key("concurrentDeploymentPercentage") ok.Integer(*v.ConcurrentDeploymentPercentage) } if v.DownloadConditionFile != nil { ok := object.Key("downloadConditionFile") if err := awsRestjson1_serializeDocumentS3Object(v.DownloadConditionFile, ok); err != nil { return err } } if v.FailureThresholdPercentage != nil { ok := object.Key("failureThresholdPercentage") ok.Integer(*v.FailureThresholdPercentage) } if v.RobotDeploymentTimeoutInSeconds != nil { ok := object.Key("robotDeploymentTimeoutInSeconds") ok.Long(*v.RobotDeploymentTimeoutInSeconds) } return nil } func awsRestjson1_serializeDocumentDeploymentLaunchConfig(v *types.DeploymentLaunchConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EnvironmentVariables != nil { ok := object.Key("environmentVariables") if err := awsRestjson1_serializeDocumentEnvironmentVariableMap(v.EnvironmentVariables, ok); err != nil { return err } } if v.LaunchFile != nil { ok := object.Key("launchFile") ok.String(*v.LaunchFile) } if v.PackageName != nil { ok := object.Key("packageName") ok.String(*v.PackageName) } if v.PostLaunchFile != nil { ok := object.Key("postLaunchFile") ok.String(*v.PostLaunchFile) } if v.PreLaunchFile != nil { ok := object.Key("preLaunchFile") ok.String(*v.PreLaunchFile) } return nil } func awsRestjson1_serializeDocumentEnvironment(v *types.Environment, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Uri != nil { ok := object.Key("uri") ok.String(*v.Uri) } return nil } func awsRestjson1_serializeDocumentEnvironmentVariableMap(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_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFilters(v []types.Filter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFilterValues(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentLaunchConfig(v *types.LaunchConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Command != nil { ok := object.Key("command") if err := awsRestjson1_serializeDocumentCommandList(v.Command, ok); err != nil { return err } } if v.EnvironmentVariables != nil { ok := object.Key("environmentVariables") if err := awsRestjson1_serializeDocumentEnvironmentVariableMap(v.EnvironmentVariables, ok); err != nil { return err } } if v.LaunchFile != nil { ok := object.Key("launchFile") ok.String(*v.LaunchFile) } if v.PackageName != nil { ok := object.Key("packageName") ok.String(*v.PackageName) } if v.PortForwardingConfig != nil { ok := object.Key("portForwardingConfig") if err := awsRestjson1_serializeDocumentPortForwardingConfig(v.PortForwardingConfig, ok); err != nil { return err } } if v.StreamUI { ok := object.Key("streamUI") ok.Boolean(v.StreamUI) } return nil } func awsRestjson1_serializeDocumentLoggingConfig(v *types.LoggingConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RecordAllRosTopics != nil { ok := object.Key("recordAllRosTopics") ok.Boolean(*v.RecordAllRosTopics) } return nil } func awsRestjson1_serializeDocumentOutputLocation(v *types.OutputLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3Prefix != nil { ok := object.Key("s3Prefix") ok.String(*v.S3Prefix) } return nil } func awsRestjson1_serializeDocumentPortForwardingConfig(v *types.PortForwardingConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PortMappings != nil { ok := object.Key("portMappings") if err := awsRestjson1_serializeDocumentPortMappingList(v.PortMappings, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPortMapping(v *types.PortMapping, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("applicationPort") ok.Integer(v.ApplicationPort) } if v.EnableOnPublicIp { ok := object.Key("enableOnPublicIp") ok.Boolean(v.EnableOnPublicIp) } { ok := object.Key("jobPort") ok.Integer(v.JobPort) } return nil } func awsRestjson1_serializeDocumentPortMappingList(v []types.PortMapping, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentPortMapping(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentRenderingEngine(v *types.RenderingEngine, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsRestjson1_serializeDocumentRobotApplicationConfig(v *types.RobotApplicationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } if v.LaunchConfig != nil { ok := object.Key("launchConfig") if err := awsRestjson1_serializeDocumentLaunchConfig(v.LaunchConfig, ok); err != nil { return err } } if v.Tools != nil { ok := object.Key("tools") if err := awsRestjson1_serializeDocumentTools(v.Tools, ok); err != nil { return err } } if v.UploadConfigurations != nil { ok := object.Key("uploadConfigurations") if err := awsRestjson1_serializeDocumentUploadConfigurations(v.UploadConfigurations, ok); err != nil { return err } } if v.UseDefaultTools != nil { ok := object.Key("useDefaultTools") ok.Boolean(*v.UseDefaultTools) } if v.UseDefaultUploadConfigurations != nil { ok := object.Key("useDefaultUploadConfigurations") ok.Boolean(*v.UseDefaultUploadConfigurations) } return nil } func awsRestjson1_serializeDocumentRobotApplicationConfigs(v []types.RobotApplicationConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentRobotApplicationConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentRobotSoftwareSuite(v *types.RobotSoftwareSuite, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) } if len(v.Version) > 0 { ok := object.Key("version") ok.String(string(v.Version)) } return nil } func awsRestjson1_serializeDocumentS3Etags(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentS3KeysOrPrefixes(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentS3Object(v *types.S3Object, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("bucket") ok.String(*v.Bucket) } if v.Etag != nil { ok := object.Key("etag") ok.String(*v.Etag) } if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } return nil } func awsRestjson1_serializeDocumentSecurityGroups(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentSimulationApplicationConfig(v *types.SimulationApplicationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Application != nil { ok := object.Key("application") ok.String(*v.Application) } if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.String(*v.ApplicationVersion) } if v.LaunchConfig != nil { ok := object.Key("launchConfig") if err := awsRestjson1_serializeDocumentLaunchConfig(v.LaunchConfig, ok); err != nil { return err } } if v.Tools != nil { ok := object.Key("tools") if err := awsRestjson1_serializeDocumentTools(v.Tools, ok); err != nil { return err } } if v.UploadConfigurations != nil { ok := object.Key("uploadConfigurations") if err := awsRestjson1_serializeDocumentUploadConfigurations(v.UploadConfigurations, ok); err != nil { return err } } if v.UseDefaultTools != nil { ok := object.Key("useDefaultTools") ok.Boolean(*v.UseDefaultTools) } if v.UseDefaultUploadConfigurations != nil { ok := object.Key("useDefaultUploadConfigurations") ok.Boolean(*v.UseDefaultUploadConfigurations) } if v.WorldConfigs != nil { ok := object.Key("worldConfigs") if err := awsRestjson1_serializeDocumentWorldConfigs(v.WorldConfigs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSimulationApplicationConfigs(v []types.SimulationApplicationConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSimulationApplicationConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSimulationJobRequest(v *types.SimulationJobRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Compute != nil { ok := object.Key("compute") if err := awsRestjson1_serializeDocumentCompute(v.Compute, ok); err != nil { return err } } if v.DataSources != nil { ok := object.Key("dataSources") if err := awsRestjson1_serializeDocumentDataSourceConfigs(v.DataSources, ok); err != nil { return err } } if len(v.FailureBehavior) > 0 { ok := object.Key("failureBehavior") ok.String(string(v.FailureBehavior)) } if v.IamRole != nil { ok := object.Key("iamRole") ok.String(*v.IamRole) } if v.LoggingConfig != nil { ok := object.Key("loggingConfig") if err := awsRestjson1_serializeDocumentLoggingConfig(v.LoggingConfig, ok); err != nil { return err } } { ok := object.Key("maxJobDurationInSeconds") ok.Long(v.MaxJobDurationInSeconds) } if v.OutputLocation != nil { ok := object.Key("outputLocation") if err := awsRestjson1_serializeDocumentOutputLocation(v.OutputLocation, ok); err != nil { return err } } if v.RobotApplications != nil { ok := object.Key("robotApplications") if err := awsRestjson1_serializeDocumentRobotApplicationConfigs(v.RobotApplications, ok); err != nil { return err } } if v.SimulationApplications != nil { ok := object.Key("simulationApplications") if err := awsRestjson1_serializeDocumentSimulationApplicationConfigs(v.SimulationApplications, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.UseDefaultApplications != nil { ok := object.Key("useDefaultApplications") ok.Boolean(*v.UseDefaultApplications) } if v.VpcConfig != nil { ok := object.Key("vpcConfig") if err := awsRestjson1_serializeDocumentVPCConfig(v.VpcConfig, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSimulationSoftwareSuite(v *types.SimulationSoftwareSuite, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) } if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) } return nil } func awsRestjson1_serializeDocumentSourceConfig(v *types.SourceConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Architecture) > 0 { ok := object.Key("architecture") ok.String(string(v.Architecture)) } if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3Key != nil { ok := object.Key("s3Key") ok.String(*v.S3Key) } return nil } func awsRestjson1_serializeDocumentSourceConfigs(v []types.SourceConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSourceConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSubnets(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentTemplateLocation(v *types.TemplateLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3Key != nil { ok := object.Key("s3Key") ok.String(*v.S3Key) } return nil } func awsRestjson1_serializeDocumentTool(v *types.Tool, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Command != nil { ok := object.Key("command") ok.String(*v.Command) } if len(v.ExitBehavior) > 0 { ok := object.Key("exitBehavior") ok.String(string(v.ExitBehavior)) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.StreamOutputToCloudWatch != nil { ok := object.Key("streamOutputToCloudWatch") ok.Boolean(*v.StreamOutputToCloudWatch) } if v.StreamUI != nil { ok := object.Key("streamUI") ok.Boolean(*v.StreamUI) } return nil } func awsRestjson1_serializeDocumentTools(v []types.Tool, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTool(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentUploadConfiguration(v *types.UploadConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Path != nil { ok := object.Key("path") ok.String(*v.Path) } if len(v.UploadBehavior) > 0 { ok := object.Key("uploadBehavior") ok.String(string(v.UploadBehavior)) } return nil } func awsRestjson1_serializeDocumentUploadConfigurations(v []types.UploadConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentUploadConfiguration(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVPCConfig(v *types.VPCConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignPublicIp { ok := object.Key("assignPublicIp") ok.Boolean(v.AssignPublicIp) } if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocumentSecurityGroups(v.SecurityGroups, ok); err != nil { return err } } if v.Subnets != nil { ok := object.Key("subnets") if err := awsRestjson1_serializeDocumentSubnets(v.Subnets, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentWorldConfig(v *types.WorldConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.World != nil { ok := object.Key("world") ok.String(*v.World) } return nil } func awsRestjson1_serializeDocumentWorldConfigs(v []types.WorldConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentWorldConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentWorldCount(v *types.WorldCount, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FloorplanCount != nil { ok := object.Key("floorplanCount") ok.Integer(*v.FloorplanCount) } if v.InteriorCountPerFloorplan != nil { ok := object.Key("interiorCountPerFloorplan") ok.Integer(*v.InteriorCountPerFloorplan) } return nil }
5,425
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package robomaker import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpBatchDeleteWorlds struct { } func (*validateOpBatchDeleteWorlds) ID() string { return "OperationInputValidation" } func (m *validateOpBatchDeleteWorlds) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*BatchDeleteWorldsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpBatchDeleteWorldsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpBatchDescribeSimulationJob struct { } func (*validateOpBatchDescribeSimulationJob) ID() string { return "OperationInputValidation" } func (m *validateOpBatchDescribeSimulationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*BatchDescribeSimulationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpBatchDescribeSimulationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelDeploymentJob struct { } func (*validateOpCancelDeploymentJob) ID() string { return "OperationInputValidation" } func (m *validateOpCancelDeploymentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelDeploymentJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelDeploymentJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelSimulationJobBatch struct { } func (*validateOpCancelSimulationJobBatch) ID() string { return "OperationInputValidation" } func (m *validateOpCancelSimulationJobBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelSimulationJobBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelSimulationJobBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelSimulationJob struct { } func (*validateOpCancelSimulationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCancelSimulationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelSimulationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelSimulationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelWorldExportJob struct { } func (*validateOpCancelWorldExportJob) ID() string { return "OperationInputValidation" } func (m *validateOpCancelWorldExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelWorldExportJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelWorldExportJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelWorldGenerationJob struct { } func (*validateOpCancelWorldGenerationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCancelWorldGenerationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelWorldGenerationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelWorldGenerationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDeploymentJob struct { } func (*validateOpCreateDeploymentJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDeploymentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDeploymentJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDeploymentJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateFleet struct { } func (*validateOpCreateFleet) ID() string { return "OperationInputValidation" } func (m *validateOpCreateFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateFleetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateFleetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateRobotApplication struct { } func (*validateOpCreateRobotApplication) ID() string { return "OperationInputValidation" } func (m *validateOpCreateRobotApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateRobotApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateRobotApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateRobotApplicationVersion struct { } func (*validateOpCreateRobotApplicationVersion) ID() string { return "OperationInputValidation" } func (m *validateOpCreateRobotApplicationVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateRobotApplicationVersionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateRobotApplicationVersionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateRobot struct { } func (*validateOpCreateRobot) ID() string { return "OperationInputValidation" } func (m *validateOpCreateRobot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateRobotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateRobotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSimulationApplication struct { } func (*validateOpCreateSimulationApplication) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSimulationApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSimulationApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSimulationApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSimulationApplicationVersion struct { } func (*validateOpCreateSimulationApplicationVersion) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSimulationApplicationVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSimulationApplicationVersionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSimulationApplicationVersionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSimulationJob struct { } func (*validateOpCreateSimulationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSimulationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSimulationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSimulationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorldExportJob struct { } func (*validateOpCreateWorldExportJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorldExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorldExportJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorldExportJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorldGenerationJob struct { } func (*validateOpCreateWorldGenerationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorldGenerationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorldGenerationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorldGenerationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorldTemplate struct { } func (*validateOpCreateWorldTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorldTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorldTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorldTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteFleet struct { } func (*validateOpDeleteFleet) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteFleetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteFleetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteRobotApplication struct { } func (*validateOpDeleteRobotApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteRobotApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteRobotApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteRobotApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteRobot struct { } func (*validateOpDeleteRobot) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteRobot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteRobotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteRobotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSimulationApplication struct { } func (*validateOpDeleteSimulationApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSimulationApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSimulationApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSimulationApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteWorldTemplate struct { } func (*validateOpDeleteWorldTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteWorldTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteWorldTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteWorldTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeregisterRobot struct { } func (*validateOpDeregisterRobot) ID() string { return "OperationInputValidation" } func (m *validateOpDeregisterRobot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeregisterRobotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeregisterRobotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDeploymentJob struct { } func (*validateOpDescribeDeploymentJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDeploymentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDeploymentJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDeploymentJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeFleet struct { } func (*validateOpDescribeFleet) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeFleetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeFleetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeRobotApplication struct { } func (*validateOpDescribeRobotApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeRobotApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeRobotApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeRobotApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeRobot struct { } func (*validateOpDescribeRobot) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeRobot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeRobotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeRobotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSimulationApplication struct { } func (*validateOpDescribeSimulationApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSimulationApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSimulationApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSimulationApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSimulationJobBatch struct { } func (*validateOpDescribeSimulationJobBatch) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSimulationJobBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSimulationJobBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSimulationJobBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSimulationJob struct { } func (*validateOpDescribeSimulationJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSimulationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSimulationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSimulationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorldExportJob struct { } func (*validateOpDescribeWorldExportJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorldExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorldExportJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorldExportJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorldGenerationJob struct { } func (*validateOpDescribeWorldGenerationJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorldGenerationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorldGenerationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorldGenerationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorld struct { } func (*validateOpDescribeWorld) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorld) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorldInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorldInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorldTemplate struct { } func (*validateOpDescribeWorldTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorldTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorldTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorldTemplateInput(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 validateOpRegisterRobot struct { } func (*validateOpRegisterRobot) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterRobot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterRobotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterRobotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRestartSimulationJob struct { } func (*validateOpRestartSimulationJob) ID() string { return "OperationInputValidation" } func (m *validateOpRestartSimulationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RestartSimulationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRestartSimulationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartSimulationJobBatch struct { } func (*validateOpStartSimulationJobBatch) ID() string { return "OperationInputValidation" } func (m *validateOpStartSimulationJobBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartSimulationJobBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartSimulationJobBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSyncDeploymentJob struct { } func (*validateOpSyncDeploymentJob) ID() string { return "OperationInputValidation" } func (m *validateOpSyncDeploymentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SyncDeploymentJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSyncDeploymentJobInput(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 validateOpUpdateRobotApplication struct { } func (*validateOpUpdateRobotApplication) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateRobotApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateRobotApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateRobotApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSimulationApplication struct { } func (*validateOpUpdateSimulationApplication) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSimulationApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSimulationApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSimulationApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateWorldTemplate struct { } func (*validateOpUpdateWorldTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateWorldTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateWorldTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateWorldTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpBatchDeleteWorldsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchDeleteWorlds{}, middleware.After) } func addOpBatchDescribeSimulationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchDescribeSimulationJob{}, middleware.After) } func addOpCancelDeploymentJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelDeploymentJob{}, middleware.After) } func addOpCancelSimulationJobBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelSimulationJobBatch{}, middleware.After) } func addOpCancelSimulationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelSimulationJob{}, middleware.After) } func addOpCancelWorldExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelWorldExportJob{}, middleware.After) } func addOpCancelWorldGenerationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelWorldGenerationJob{}, middleware.After) } func addOpCreateDeploymentJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDeploymentJob{}, middleware.After) } func addOpCreateFleetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFleet{}, middleware.After) } func addOpCreateRobotApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRobotApplication{}, middleware.After) } func addOpCreateRobotApplicationVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRobotApplicationVersion{}, middleware.After) } func addOpCreateRobotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRobot{}, middleware.After) } func addOpCreateSimulationApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSimulationApplication{}, middleware.After) } func addOpCreateSimulationApplicationVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSimulationApplicationVersion{}, middleware.After) } func addOpCreateSimulationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSimulationJob{}, middleware.After) } func addOpCreateWorldExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorldExportJob{}, middleware.After) } func addOpCreateWorldGenerationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorldGenerationJob{}, middleware.After) } func addOpCreateWorldTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorldTemplate{}, middleware.After) } func addOpDeleteFleetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteFleet{}, middleware.After) } func addOpDeleteRobotApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRobotApplication{}, middleware.After) } func addOpDeleteRobotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRobot{}, middleware.After) } func addOpDeleteSimulationApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSimulationApplication{}, middleware.After) } func addOpDeleteWorldTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorldTemplate{}, middleware.After) } func addOpDeregisterRobotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterRobot{}, middleware.After) } func addOpDescribeDeploymentJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDeploymentJob{}, middleware.After) } func addOpDescribeFleetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeFleet{}, middleware.After) } func addOpDescribeRobotApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeRobotApplication{}, middleware.After) } func addOpDescribeRobotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeRobot{}, middleware.After) } func addOpDescribeSimulationApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSimulationApplication{}, middleware.After) } func addOpDescribeSimulationJobBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSimulationJobBatch{}, middleware.After) } func addOpDescribeSimulationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSimulationJob{}, middleware.After) } func addOpDescribeWorldExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorldExportJob{}, middleware.After) } func addOpDescribeWorldGenerationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorldGenerationJob{}, middleware.After) } func addOpDescribeWorldValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorld{}, middleware.After) } func addOpDescribeWorldTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorldTemplate{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpRegisterRobotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterRobot{}, middleware.After) } func addOpRestartSimulationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRestartSimulationJob{}, middleware.After) } func addOpStartSimulationJobBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartSimulationJobBatch{}, middleware.After) } func addOpSyncDeploymentJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSyncDeploymentJob{}, 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 addOpUpdateRobotApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRobotApplication{}, middleware.After) } func addOpUpdateSimulationApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSimulationApplication{}, middleware.After) } func addOpUpdateWorldTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateWorldTemplate{}, middleware.After) } func validateCreateSimulationJobRequests(v []types.SimulationJobRequest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSimulationJobRequests"} for i := range v { if err := validateSimulationJobRequest(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSourceConfig(v *types.DataSourceConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSourceConfig"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if v.S3Keys == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Keys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSourceConfigs(v []types.DataSourceConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSourceConfigs"} for i := range v { if err := validateDataSourceConfig(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeploymentApplicationConfig(v *types.DeploymentApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeploymentApplicationConfig"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if v.ApplicationVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationVersion")) } if v.LaunchConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfig")) } else if v.LaunchConfig != nil { if err := validateDeploymentLaunchConfig(v.LaunchConfig); err != nil { invalidParams.AddNested("LaunchConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeploymentApplicationConfigs(v []types.DeploymentApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeploymentApplicationConfigs"} for i := range v { if err := validateDeploymentApplicationConfig(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeploymentConfig(v *types.DeploymentConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeploymentConfig"} if v.DownloadConditionFile != nil { if err := validateS3Object(v.DownloadConditionFile); err != nil { invalidParams.AddNested("DownloadConditionFile", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeploymentLaunchConfig(v *types.DeploymentLaunchConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeploymentLaunchConfig"} if v.PackageName == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageName")) } if v.LaunchFile == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchFile")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLaunchConfig(v *types.LaunchConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LaunchConfig"} if v.PortForwardingConfig != nil { if err := validatePortForwardingConfig(v.PortForwardingConfig); err != nil { invalidParams.AddNested("PortForwardingConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePortForwardingConfig(v *types.PortForwardingConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PortForwardingConfig"} if v.PortMappings != nil { if err := validatePortMappingList(v.PortMappings); err != nil { invalidParams.AddNested("PortMappings", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePortMapping(v *types.PortMapping) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PortMapping"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePortMappingList(v []types.PortMapping) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PortMappingList"} for i := range v { if err := validatePortMapping(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRobotApplicationConfig(v *types.RobotApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RobotApplicationConfig"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if v.LaunchConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfig")) } else if v.LaunchConfig != nil { if err := validateLaunchConfig(v.LaunchConfig); err != nil { invalidParams.AddNested("LaunchConfig", err.(smithy.InvalidParamsError)) } } if v.UploadConfigurations != nil { if err := validateUploadConfigurations(v.UploadConfigurations); err != nil { invalidParams.AddNested("UploadConfigurations", err.(smithy.InvalidParamsError)) } } if v.Tools != nil { if err := validateTools(v.Tools); err != nil { invalidParams.AddNested("Tools", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRobotApplicationConfigs(v []types.RobotApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RobotApplicationConfigs"} for i := range v { if err := validateRobotApplicationConfig(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Object(v *types.S3Object) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Object"} if v.Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("Bucket")) } if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSimulationApplicationConfig(v *types.SimulationApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SimulationApplicationConfig"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if v.LaunchConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfig")) } else if v.LaunchConfig != nil { if err := validateLaunchConfig(v.LaunchConfig); err != nil { invalidParams.AddNested("LaunchConfig", err.(smithy.InvalidParamsError)) } } if v.UploadConfigurations != nil { if err := validateUploadConfigurations(v.UploadConfigurations); err != nil { invalidParams.AddNested("UploadConfigurations", err.(smithy.InvalidParamsError)) } } if v.Tools != nil { if err := validateTools(v.Tools); err != nil { invalidParams.AddNested("Tools", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSimulationApplicationConfigs(v []types.SimulationApplicationConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SimulationApplicationConfigs"} for i := range v { if err := validateSimulationApplicationConfig(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSimulationJobRequest(v *types.SimulationJobRequest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SimulationJobRequest"} if v.RobotApplications != nil { if err := validateRobotApplicationConfigs(v.RobotApplications); err != nil { invalidParams.AddNested("RobotApplications", err.(smithy.InvalidParamsError)) } } if v.SimulationApplications != nil { if err := validateSimulationApplicationConfigs(v.SimulationApplications); err != nil { invalidParams.AddNested("SimulationApplications", err.(smithy.InvalidParamsError)) } } if v.DataSources != nil { if err := validateDataSourceConfigs(v.DataSources); err != nil { invalidParams.AddNested("DataSources", err.(smithy.InvalidParamsError)) } } if v.VpcConfig != nil { if err := validateVPCConfig(v.VpcConfig); err != nil { invalidParams.AddNested("VpcConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTemplateLocation(v *types.TemplateLocation) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TemplateLocation"} if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if v.S3Key == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTool(v *types.Tool) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tool"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Command == nil { invalidParams.Add(smithy.NewErrParamRequired("Command")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTools(v []types.Tool) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tools"} for i := range v { if err := validateTool(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateUploadConfiguration(v *types.UploadConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UploadConfiguration"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Path == nil { invalidParams.Add(smithy.NewErrParamRequired("Path")) } if len(v.UploadBehavior) == 0 { invalidParams.Add(smithy.NewErrParamRequired("UploadBehavior")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateUploadConfigurations(v []types.UploadConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UploadConfigurations"} for i := range v { if err := validateUploadConfiguration(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVPCConfig(v *types.VPCConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VPCConfig"} if v.Subnets == nil { invalidParams.Add(smithy.NewErrParamRequired("Subnets")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpBatchDeleteWorldsInput(v *BatchDeleteWorldsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteWorldsInput"} if v.Worlds == nil { invalidParams.Add(smithy.NewErrParamRequired("Worlds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpBatchDescribeSimulationJobInput(v *BatchDescribeSimulationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchDescribeSimulationJobInput"} if v.Jobs == nil { invalidParams.Add(smithy.NewErrParamRequired("Jobs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelDeploymentJobInput(v *CancelDeploymentJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelDeploymentJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelSimulationJobBatchInput(v *CancelSimulationJobBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelSimulationJobBatchInput"} if v.Batch == nil { invalidParams.Add(smithy.NewErrParamRequired("Batch")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelSimulationJobInput(v *CancelSimulationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelSimulationJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelWorldExportJobInput(v *CancelWorldExportJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelWorldExportJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelWorldGenerationJobInput(v *CancelWorldGenerationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelWorldGenerationJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDeploymentJobInput(v *CreateDeploymentJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDeploymentJobInput"} if v.DeploymentConfig != nil { if err := validateDeploymentConfig(v.DeploymentConfig); err != nil { invalidParams.AddNested("DeploymentConfig", err.(smithy.InvalidParamsError)) } } if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } if v.DeploymentApplicationConfigs == nil { invalidParams.Add(smithy.NewErrParamRequired("DeploymentApplicationConfigs")) } else if v.DeploymentApplicationConfigs != nil { if err := validateDeploymentApplicationConfigs(v.DeploymentApplicationConfigs); err != nil { invalidParams.AddNested("DeploymentApplicationConfigs", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateFleetInput(v *CreateFleetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateFleetInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateRobotApplicationInput(v *CreateRobotApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateRobotApplicationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.RobotSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("RobotSoftwareSuite")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateRobotApplicationVersionInput(v *CreateRobotApplicationVersionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateRobotApplicationVersionInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateRobotInput(v *CreateRobotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateRobotInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.Architecture) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Architecture")) } if v.GreengrassGroupId == nil { invalidParams.Add(smithy.NewErrParamRequired("GreengrassGroupId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSimulationApplicationInput(v *CreateSimulationApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSimulationApplicationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.SimulationSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("SimulationSoftwareSuite")) } if v.RobotSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("RobotSoftwareSuite")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSimulationApplicationVersionInput(v *CreateSimulationApplicationVersionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSimulationApplicationVersionInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSimulationJobInput(v *CreateSimulationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSimulationJobInput"} if v.IamRole == nil { invalidParams.Add(smithy.NewErrParamRequired("IamRole")) } if v.RobotApplications != nil { if err := validateRobotApplicationConfigs(v.RobotApplications); err != nil { invalidParams.AddNested("RobotApplications", err.(smithy.InvalidParamsError)) } } if v.SimulationApplications != nil { if err := validateSimulationApplicationConfigs(v.SimulationApplications); err != nil { invalidParams.AddNested("SimulationApplications", err.(smithy.InvalidParamsError)) } } if v.DataSources != nil { if err := validateDataSourceConfigs(v.DataSources); err != nil { invalidParams.AddNested("DataSources", err.(smithy.InvalidParamsError)) } } if v.VpcConfig != nil { if err := validateVPCConfig(v.VpcConfig); err != nil { invalidParams.AddNested("VpcConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorldExportJobInput(v *CreateWorldExportJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorldExportJobInput"} if v.Worlds == nil { invalidParams.Add(smithy.NewErrParamRequired("Worlds")) } if v.OutputLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("OutputLocation")) } if v.IamRole == nil { invalidParams.Add(smithy.NewErrParamRequired("IamRole")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorldGenerationJobInput(v *CreateWorldGenerationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorldGenerationJobInput"} if v.Template == nil { invalidParams.Add(smithy.NewErrParamRequired("Template")) } if v.WorldCount == nil { invalidParams.Add(smithy.NewErrParamRequired("WorldCount")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorldTemplateInput(v *CreateWorldTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorldTemplateInput"} if v.TemplateLocation != nil { if err := validateTemplateLocation(v.TemplateLocation); err != nil { invalidParams.AddNested("TemplateLocation", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteFleetInput(v *DeleteFleetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteFleetInput"} if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteRobotApplicationInput(v *DeleteRobotApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteRobotApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteRobotInput(v *DeleteRobotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteRobotInput"} if v.Robot == nil { invalidParams.Add(smithy.NewErrParamRequired("Robot")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSimulationApplicationInput(v *DeleteSimulationApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSimulationApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteWorldTemplateInput(v *DeleteWorldTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteWorldTemplateInput"} if v.Template == nil { invalidParams.Add(smithy.NewErrParamRequired("Template")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeregisterRobotInput(v *DeregisterRobotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeregisterRobotInput"} if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } if v.Robot == nil { invalidParams.Add(smithy.NewErrParamRequired("Robot")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDeploymentJobInput(v *DescribeDeploymentJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDeploymentJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeFleetInput(v *DescribeFleetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeFleetInput"} if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeRobotApplicationInput(v *DescribeRobotApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeRobotApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeRobotInput(v *DescribeRobotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeRobotInput"} if v.Robot == nil { invalidParams.Add(smithy.NewErrParamRequired("Robot")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSimulationApplicationInput(v *DescribeSimulationApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSimulationApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSimulationJobBatchInput(v *DescribeSimulationJobBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSimulationJobBatchInput"} if v.Batch == nil { invalidParams.Add(smithy.NewErrParamRequired("Batch")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSimulationJobInput(v *DescribeSimulationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSimulationJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorldExportJobInput(v *DescribeWorldExportJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorldExportJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorldGenerationJobInput(v *DescribeWorldGenerationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorldGenerationJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorldInput(v *DescribeWorldInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorldInput"} if v.World == nil { invalidParams.Add(smithy.NewErrParamRequired("World")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorldTemplateInput(v *DescribeWorldTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorldTemplateInput"} if v.Template == nil { invalidParams.Add(smithy.NewErrParamRequired("Template")) } 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 validateOpRegisterRobotInput(v *RegisterRobotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterRobotInput"} if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } if v.Robot == nil { invalidParams.Add(smithy.NewErrParamRequired("Robot")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRestartSimulationJobInput(v *RestartSimulationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RestartSimulationJobInput"} if v.Job == nil { invalidParams.Add(smithy.NewErrParamRequired("Job")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartSimulationJobBatchInput(v *StartSimulationJobBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartSimulationJobBatchInput"} if v.CreateSimulationJobRequests == nil { invalidParams.Add(smithy.NewErrParamRequired("CreateSimulationJobRequests")) } else if v.CreateSimulationJobRequests != nil { if err := validateCreateSimulationJobRequests(v.CreateSimulationJobRequests); err != nil { invalidParams.AddNested("CreateSimulationJobRequests", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSyncDeploymentJobInput(v *SyncDeploymentJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SyncDeploymentJobInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.Fleet == nil { invalidParams.Add(smithy.NewErrParamRequired("Fleet")) } 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 validateOpUpdateRobotApplicationInput(v *UpdateRobotApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRobotApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if v.RobotSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("RobotSoftwareSuite")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSimulationApplicationInput(v *UpdateSimulationApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSimulationApplicationInput"} if v.Application == nil { invalidParams.Add(smithy.NewErrParamRequired("Application")) } if v.SimulationSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("SimulationSoftwareSuite")) } if v.RobotSoftwareSuite == nil { invalidParams.Add(smithy.NewErrParamRequired("RobotSoftwareSuite")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateWorldTemplateInput(v *UpdateWorldTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateWorldTemplateInput"} if v.Template == nil { invalidParams.Add(smithy.NewErrParamRequired("Template")) } if v.TemplateLocation != nil { if err := validateTemplateLocation(v.TemplateLocation); err != nil { invalidParams.AddNested("TemplateLocation", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,310
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 RoboMaker 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: "robomaker.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "robomaker-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "robomaker-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "robomaker.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "robomaker-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "robomaker-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{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: "robomaker-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{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: "robomaker-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{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: "robomaker-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{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: "robomaker-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{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: "robomaker.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "robomaker-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "robomaker-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "robomaker.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, }, }, }
325
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 Architecture string // Enum values for Architecture const ( ArchitectureX8664 Architecture = "X86_64" ArchitectureArm64 Architecture = "ARM64" ArchitectureArmhf Architecture = "ARMHF" ) // Values returns all known values for Architecture. 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 (Architecture) Values() []Architecture { return []Architecture{ "X86_64", "ARM64", "ARMHF", } } type ComputeType string // Enum values for ComputeType const ( ComputeTypeCpu ComputeType = "CPU" ComputeTypeGpuAndCpu ComputeType = "GPU_AND_CPU" ) // Values returns all known values for ComputeType. 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 (ComputeType) Values() []ComputeType { return []ComputeType{ "CPU", "GPU_AND_CPU", } } type DataSourceType string // Enum values for DataSourceType const ( DataSourceTypePrefix DataSourceType = "Prefix" DataSourceTypeArchive DataSourceType = "Archive" DataSourceTypeFile DataSourceType = "File" ) // Values returns all known values for DataSourceType. 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 (DataSourceType) Values() []DataSourceType { return []DataSourceType{ "Prefix", "Archive", "File", } } type DeploymentJobErrorCode string // Enum values for DeploymentJobErrorCode const ( DeploymentJobErrorCodeResourceNotFound DeploymentJobErrorCode = "ResourceNotFound" DeploymentJobErrorCodeEnvironmentSetupError DeploymentJobErrorCode = "EnvironmentSetupError" DeploymentJobErrorCodeEtagMismatch DeploymentJobErrorCode = "EtagMismatch" DeploymentJobErrorCodeFailureThresholdBreached DeploymentJobErrorCode = "FailureThresholdBreached" DeploymentJobErrorCodeRobotDeploymentAborted DeploymentJobErrorCode = "RobotDeploymentAborted" DeploymentJobErrorCodeRobotDeploymentNoResponse DeploymentJobErrorCode = "RobotDeploymentNoResponse" DeploymentJobErrorCodeRobotAgentConnectionTimeout DeploymentJobErrorCode = "RobotAgentConnectionTimeout" DeploymentJobErrorCodeGreengrassDeploymentFailed DeploymentJobErrorCode = "GreengrassDeploymentFailed" DeploymentJobErrorCodeInvalidGreengrassGroup DeploymentJobErrorCode = "InvalidGreengrassGroup" DeploymentJobErrorCodeMissingRobotArchitecture DeploymentJobErrorCode = "MissingRobotArchitecture" DeploymentJobErrorCodeMissingRobotApplicationArchitecture DeploymentJobErrorCode = "MissingRobotApplicationArchitecture" DeploymentJobErrorCodeMissingRobotDeploymentResource DeploymentJobErrorCode = "MissingRobotDeploymentResource" DeploymentJobErrorCodeGreengrassGroupVersionDoesNotExist DeploymentJobErrorCode = "GreengrassGroupVersionDoesNotExist" DeploymentJobErrorCodeLambdaDeleted DeploymentJobErrorCode = "LambdaDeleted" DeploymentJobErrorCodeExtractingBundleFailure DeploymentJobErrorCode = "ExtractingBundleFailure" DeploymentJobErrorCodePreLaunchFileFailure DeploymentJobErrorCode = "PreLaunchFileFailure" DeploymentJobErrorCodePostLaunchFileFailure DeploymentJobErrorCode = "PostLaunchFileFailure" DeploymentJobErrorCodeBadPermissionError DeploymentJobErrorCode = "BadPermissionError" DeploymentJobErrorCodeDownloadConditionFailed DeploymentJobErrorCode = "DownloadConditionFailed" DeploymentJobErrorCodeBadLambdaAssociated DeploymentJobErrorCode = "BadLambdaAssociated" DeploymentJobErrorCodeInternalServerError DeploymentJobErrorCode = "InternalServerError" DeploymentJobErrorCodeRobotApplicationDoesNotExist DeploymentJobErrorCode = "RobotApplicationDoesNotExist" DeploymentJobErrorCodeDeploymentFleetDoesNotExist DeploymentJobErrorCode = "DeploymentFleetDoesNotExist" DeploymentJobErrorCodeFleetDeploymentTimeout DeploymentJobErrorCode = "FleetDeploymentTimeout" ) // Values returns all known values for DeploymentJobErrorCode. 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 (DeploymentJobErrorCode) Values() []DeploymentJobErrorCode { return []DeploymentJobErrorCode{ "ResourceNotFound", "EnvironmentSetupError", "EtagMismatch", "FailureThresholdBreached", "RobotDeploymentAborted", "RobotDeploymentNoResponse", "RobotAgentConnectionTimeout", "GreengrassDeploymentFailed", "InvalidGreengrassGroup", "MissingRobotArchitecture", "MissingRobotApplicationArchitecture", "MissingRobotDeploymentResource", "GreengrassGroupVersionDoesNotExist", "LambdaDeleted", "ExtractingBundleFailure", "PreLaunchFileFailure", "PostLaunchFileFailure", "BadPermissionError", "DownloadConditionFailed", "BadLambdaAssociated", "InternalServerError", "RobotApplicationDoesNotExist", "DeploymentFleetDoesNotExist", "FleetDeploymentTimeout", } } type DeploymentStatus string // Enum values for DeploymentStatus const ( DeploymentStatusPending DeploymentStatus = "Pending" DeploymentStatusPreparing DeploymentStatus = "Preparing" DeploymentStatusInProgress DeploymentStatus = "InProgress" DeploymentStatusFailed DeploymentStatus = "Failed" DeploymentStatusSucceeded DeploymentStatus = "Succeeded" DeploymentStatusCanceled DeploymentStatus = "Canceled" ) // Values returns all known values for DeploymentStatus. 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 (DeploymentStatus) Values() []DeploymentStatus { return []DeploymentStatus{ "Pending", "Preparing", "InProgress", "Failed", "Succeeded", "Canceled", } } type ExitBehavior string // Enum values for ExitBehavior const ( ExitBehaviorFail ExitBehavior = "FAIL" ExitBehaviorRestart ExitBehavior = "RESTART" ) // Values returns all known values for ExitBehavior. 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 (ExitBehavior) Values() []ExitBehavior { return []ExitBehavior{ "FAIL", "RESTART", } } type FailureBehavior string // Enum values for FailureBehavior const ( FailureBehaviorFail FailureBehavior = "Fail" FailureBehaviorContinue FailureBehavior = "Continue" ) // Values returns all known values for FailureBehavior. 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 (FailureBehavior) Values() []FailureBehavior { return []FailureBehavior{ "Fail", "Continue", } } type RenderingEngineType string // Enum values for RenderingEngineType const ( RenderingEngineTypeOgre RenderingEngineType = "OGRE" ) // Values returns all known values for RenderingEngineType. 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 (RenderingEngineType) Values() []RenderingEngineType { return []RenderingEngineType{ "OGRE", } } type RobotDeploymentStep string // Enum values for RobotDeploymentStep const ( RobotDeploymentStepValidatingStep RobotDeploymentStep = "Validating" RobotDeploymentStepDownloadingExtractingStep RobotDeploymentStep = "DownloadingExtracting" RobotDeploymentStepExecutingDownloadCondition RobotDeploymentStep = "ExecutingDownloadCondition" RobotDeploymentStepPreLaunchStep RobotDeploymentStep = "ExecutingPreLaunch" RobotDeploymentStepLaunchingStep RobotDeploymentStep = "Launching" RobotDeploymentStepPostLaunchStep RobotDeploymentStep = "ExecutingPostLaunch" RobotDeploymentStepFinishedStep RobotDeploymentStep = "Finished" ) // Values returns all known values for RobotDeploymentStep. 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 (RobotDeploymentStep) Values() []RobotDeploymentStep { return []RobotDeploymentStep{ "Validating", "DownloadingExtracting", "ExecutingDownloadCondition", "ExecutingPreLaunch", "Launching", "ExecutingPostLaunch", "Finished", } } type RobotSoftwareSuiteType string // Enum values for RobotSoftwareSuiteType const ( RobotSoftwareSuiteTypeRos RobotSoftwareSuiteType = "ROS" RobotSoftwareSuiteTypeRos2 RobotSoftwareSuiteType = "ROS2" RobotSoftwareSuiteTypeGeneral RobotSoftwareSuiteType = "General" ) // Values returns all known values for RobotSoftwareSuiteType. 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 (RobotSoftwareSuiteType) Values() []RobotSoftwareSuiteType { return []RobotSoftwareSuiteType{ "ROS", "ROS2", "General", } } type RobotSoftwareSuiteVersionType string // Enum values for RobotSoftwareSuiteVersionType const ( RobotSoftwareSuiteVersionTypeKinetic RobotSoftwareSuiteVersionType = "Kinetic" RobotSoftwareSuiteVersionTypeMelodic RobotSoftwareSuiteVersionType = "Melodic" RobotSoftwareSuiteVersionTypeDashing RobotSoftwareSuiteVersionType = "Dashing" RobotSoftwareSuiteVersionTypeFoxy RobotSoftwareSuiteVersionType = "Foxy" ) // Values returns all known values for RobotSoftwareSuiteVersionType. 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 (RobotSoftwareSuiteVersionType) Values() []RobotSoftwareSuiteVersionType { return []RobotSoftwareSuiteVersionType{ "Kinetic", "Melodic", "Dashing", "Foxy", } } type RobotStatus string // Enum values for RobotStatus const ( RobotStatusAvailable RobotStatus = "Available" RobotStatusRegistered RobotStatus = "Registered" RobotStatusPendingNewDeployment RobotStatus = "PendingNewDeployment" RobotStatusDeploying RobotStatus = "Deploying" RobotStatusFailed RobotStatus = "Failed" RobotStatusInSync RobotStatus = "InSync" RobotStatusNoResponse RobotStatus = "NoResponse" ) // Values returns all known values for RobotStatus. 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 (RobotStatus) Values() []RobotStatus { return []RobotStatus{ "Available", "Registered", "PendingNewDeployment", "Deploying", "Failed", "InSync", "NoResponse", } } type SimulationJobBatchErrorCode string // Enum values for SimulationJobBatchErrorCode const ( SimulationJobBatchErrorCodeInternalServiceError SimulationJobBatchErrorCode = "InternalServiceError" ) // Values returns all known values for SimulationJobBatchErrorCode. 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 (SimulationJobBatchErrorCode) Values() []SimulationJobBatchErrorCode { return []SimulationJobBatchErrorCode{ "InternalServiceError", } } type SimulationJobBatchStatus string // Enum values for SimulationJobBatchStatus const ( SimulationJobBatchStatusPending SimulationJobBatchStatus = "Pending" SimulationJobBatchStatusInProgress SimulationJobBatchStatus = "InProgress" SimulationJobBatchStatusFailed SimulationJobBatchStatus = "Failed" SimulationJobBatchStatusCompleted SimulationJobBatchStatus = "Completed" SimulationJobBatchStatusCanceled SimulationJobBatchStatus = "Canceled" SimulationJobBatchStatusCanceling SimulationJobBatchStatus = "Canceling" SimulationJobBatchStatusCompleting SimulationJobBatchStatus = "Completing" SimulationJobBatchStatusTimingOut SimulationJobBatchStatus = "TimingOut" SimulationJobBatchStatusTimedOut SimulationJobBatchStatus = "TimedOut" ) // Values returns all known values for SimulationJobBatchStatus. 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 (SimulationJobBatchStatus) Values() []SimulationJobBatchStatus { return []SimulationJobBatchStatus{ "Pending", "InProgress", "Failed", "Completed", "Canceled", "Canceling", "Completing", "TimingOut", "TimedOut", } } type SimulationJobErrorCode string // Enum values for SimulationJobErrorCode const ( SimulationJobErrorCodeInternalServiceError SimulationJobErrorCode = "InternalServiceError" SimulationJobErrorCodeRobotApplicationCrash SimulationJobErrorCode = "RobotApplicationCrash" SimulationJobErrorCodeSimulationApplicationCrash SimulationJobErrorCode = "SimulationApplicationCrash" SimulationJobErrorCodeRobotApplicationHealthCheckFailure SimulationJobErrorCode = "RobotApplicationHealthCheckFailure" SimulationJobErrorCodeSimulationApplicationHealthCheckFailure SimulationJobErrorCode = "SimulationApplicationHealthCheckFailure" SimulationJobErrorCodeBadPermissionsRobotApplication SimulationJobErrorCode = "BadPermissionsRobotApplication" SimulationJobErrorCodeBadPermissionsSimulationApplication SimulationJobErrorCode = "BadPermissionsSimulationApplication" SimulationJobErrorCodeBadPermissionsS3Object SimulationJobErrorCode = "BadPermissionsS3Object" SimulationJobErrorCodeBadPermissionsS3Output SimulationJobErrorCode = "BadPermissionsS3Output" SimulationJobErrorCodeBadPermissionsCloudwatchLogs SimulationJobErrorCode = "BadPermissionsCloudwatchLogs" SimulationJobErrorCodeSubnetIpLimitExceeded SimulationJobErrorCode = "SubnetIpLimitExceeded" SimulationJobErrorCodeENILimitExceeded SimulationJobErrorCode = "ENILimitExceeded" SimulationJobErrorCodeBadPermissionsUserCredentials SimulationJobErrorCode = "BadPermissionsUserCredentials" SimulationJobErrorCodeInvalidBundleRobotApplication SimulationJobErrorCode = "InvalidBundleRobotApplication" SimulationJobErrorCodeInvalidBundleSimulationApplication SimulationJobErrorCode = "InvalidBundleSimulationApplication" SimulationJobErrorCodeInvalidS3Resource SimulationJobErrorCode = "InvalidS3Resource" SimulationJobErrorCodeThrottlingError SimulationJobErrorCode = "ThrottlingError" SimulationJobErrorCodeLimitExceeded SimulationJobErrorCode = "LimitExceeded" SimulationJobErrorCodeMismatchedEtag SimulationJobErrorCode = "MismatchedEtag" SimulationJobErrorCodeRobotApplicationVersionMismatchedEtag SimulationJobErrorCode = "RobotApplicationVersionMismatchedEtag" SimulationJobErrorCodeSimulationApplicationVersionMismatchedEtag SimulationJobErrorCode = "SimulationApplicationVersionMismatchedEtag" SimulationJobErrorCodeResourceNotFound SimulationJobErrorCode = "ResourceNotFound" SimulationJobErrorCodeRequestThrottled SimulationJobErrorCode = "RequestThrottled" SimulationJobErrorCodeBatchTimedOut SimulationJobErrorCode = "BatchTimedOut" SimulationJobErrorCodeBatchCanceled SimulationJobErrorCode = "BatchCanceled" SimulationJobErrorCodeInvalidInput SimulationJobErrorCode = "InvalidInput" SimulationJobErrorCodeWrongRegionS3Bucket SimulationJobErrorCode = "WrongRegionS3Bucket" SimulationJobErrorCodeWrongRegionS3Output SimulationJobErrorCode = "WrongRegionS3Output" SimulationJobErrorCodeWrongRegionRobotApplication SimulationJobErrorCode = "WrongRegionRobotApplication" SimulationJobErrorCodeWrongRegionSimulationApplication SimulationJobErrorCode = "WrongRegionSimulationApplication" SimulationJobErrorCodeUploadContentMismatchError SimulationJobErrorCode = "UploadContentMismatchError" ) // Values returns all known values for SimulationJobErrorCode. 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 (SimulationJobErrorCode) Values() []SimulationJobErrorCode { return []SimulationJobErrorCode{ "InternalServiceError", "RobotApplicationCrash", "SimulationApplicationCrash", "RobotApplicationHealthCheckFailure", "SimulationApplicationHealthCheckFailure", "BadPermissionsRobotApplication", "BadPermissionsSimulationApplication", "BadPermissionsS3Object", "BadPermissionsS3Output", "BadPermissionsCloudwatchLogs", "SubnetIpLimitExceeded", "ENILimitExceeded", "BadPermissionsUserCredentials", "InvalidBundleRobotApplication", "InvalidBundleSimulationApplication", "InvalidS3Resource", "ThrottlingError", "LimitExceeded", "MismatchedEtag", "RobotApplicationVersionMismatchedEtag", "SimulationApplicationVersionMismatchedEtag", "ResourceNotFound", "RequestThrottled", "BatchTimedOut", "BatchCanceled", "InvalidInput", "WrongRegionS3Bucket", "WrongRegionS3Output", "WrongRegionRobotApplication", "WrongRegionSimulationApplication", "UploadContentMismatchError", } } type SimulationJobStatus string // Enum values for SimulationJobStatus const ( SimulationJobStatusPending SimulationJobStatus = "Pending" SimulationJobStatusPreparing SimulationJobStatus = "Preparing" SimulationJobStatusRunning SimulationJobStatus = "Running" SimulationJobStatusRestarting SimulationJobStatus = "Restarting" SimulationJobStatusCompleted SimulationJobStatus = "Completed" SimulationJobStatusFailed SimulationJobStatus = "Failed" SimulationJobStatusRunningFailed SimulationJobStatus = "RunningFailed" SimulationJobStatusTerminating SimulationJobStatus = "Terminating" SimulationJobStatusTerminated SimulationJobStatus = "Terminated" SimulationJobStatusCanceled SimulationJobStatus = "Canceled" ) // Values returns all known values for SimulationJobStatus. 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 (SimulationJobStatus) Values() []SimulationJobStatus { return []SimulationJobStatus{ "Pending", "Preparing", "Running", "Restarting", "Completed", "Failed", "RunningFailed", "Terminating", "Terminated", "Canceled", } } type SimulationSoftwareSuiteType string // Enum values for SimulationSoftwareSuiteType const ( SimulationSoftwareSuiteTypeGazebo SimulationSoftwareSuiteType = "Gazebo" SimulationSoftwareSuiteTypeRosbagPlay SimulationSoftwareSuiteType = "RosbagPlay" SimulationSoftwareSuiteTypeSimulationRuntime SimulationSoftwareSuiteType = "SimulationRuntime" ) // Values returns all known values for SimulationSoftwareSuiteType. 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 (SimulationSoftwareSuiteType) Values() []SimulationSoftwareSuiteType { return []SimulationSoftwareSuiteType{ "Gazebo", "RosbagPlay", "SimulationRuntime", } } type UploadBehavior string // Enum values for UploadBehavior const ( UploadBehaviorUploadOnTerminate UploadBehavior = "UPLOAD_ON_TERMINATE" UploadBehaviorUploadRollingAutoRemove UploadBehavior = "UPLOAD_ROLLING_AUTO_REMOVE" ) // Values returns all known values for UploadBehavior. 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 (UploadBehavior) Values() []UploadBehavior { return []UploadBehavior{ "UPLOAD_ON_TERMINATE", "UPLOAD_ROLLING_AUTO_REMOVE", } } type WorldExportJobErrorCode string // Enum values for WorldExportJobErrorCode const ( WorldExportJobErrorCodeInternalServiceError WorldExportJobErrorCode = "InternalServiceError" WorldExportJobErrorCodeLimitExceeded WorldExportJobErrorCode = "LimitExceeded" WorldExportJobErrorCodeResourceNotFound WorldExportJobErrorCode = "ResourceNotFound" WorldExportJobErrorCodeRequestThrottled WorldExportJobErrorCode = "RequestThrottled" WorldExportJobErrorCodeInvalidInput WorldExportJobErrorCode = "InvalidInput" WorldExportJobErrorCodeAccessDenied WorldExportJobErrorCode = "AccessDenied" ) // Values returns all known values for WorldExportJobErrorCode. 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 (WorldExportJobErrorCode) Values() []WorldExportJobErrorCode { return []WorldExportJobErrorCode{ "InternalServiceError", "LimitExceeded", "ResourceNotFound", "RequestThrottled", "InvalidInput", "AccessDenied", } } type WorldExportJobStatus string // Enum values for WorldExportJobStatus const ( WorldExportJobStatusPending WorldExportJobStatus = "Pending" WorldExportJobStatusRunning WorldExportJobStatus = "Running" WorldExportJobStatusCompleted WorldExportJobStatus = "Completed" WorldExportJobStatusFailed WorldExportJobStatus = "Failed" WorldExportJobStatusCanceling WorldExportJobStatus = "Canceling" WorldExportJobStatusCanceled WorldExportJobStatus = "Canceled" ) // Values returns all known values for WorldExportJobStatus. 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 (WorldExportJobStatus) Values() []WorldExportJobStatus { return []WorldExportJobStatus{ "Pending", "Running", "Completed", "Failed", "Canceling", "Canceled", } } type WorldGenerationJobErrorCode string // Enum values for WorldGenerationJobErrorCode const ( WorldGenerationJobErrorCodeInternalServiceError WorldGenerationJobErrorCode = "InternalServiceError" WorldGenerationJobErrorCodeLimitExceeded WorldGenerationJobErrorCode = "LimitExceeded" WorldGenerationJobErrorCodeResourceNotFound WorldGenerationJobErrorCode = "ResourceNotFound" WorldGenerationJobErrorCodeRequestThrottled WorldGenerationJobErrorCode = "RequestThrottled" WorldGenerationJobErrorCodeInvalidInput WorldGenerationJobErrorCode = "InvalidInput" WorldGenerationJobErrorCodeAllWorldGenerationFailed WorldGenerationJobErrorCode = "AllWorldGenerationFailed" ) // Values returns all known values for WorldGenerationJobErrorCode. 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 (WorldGenerationJobErrorCode) Values() []WorldGenerationJobErrorCode { return []WorldGenerationJobErrorCode{ "InternalServiceError", "LimitExceeded", "ResourceNotFound", "RequestThrottled", "InvalidInput", "AllWorldGenerationFailed", } } type WorldGenerationJobStatus string // Enum values for WorldGenerationJobStatus const ( WorldGenerationJobStatusPending WorldGenerationJobStatus = "Pending" WorldGenerationJobStatusRunning WorldGenerationJobStatus = "Running" WorldGenerationJobStatusCompleted WorldGenerationJobStatus = "Completed" WorldGenerationJobStatusFailed WorldGenerationJobStatus = "Failed" WorldGenerationJobStatusPartialFailed WorldGenerationJobStatus = "PartialFailed" WorldGenerationJobStatusCanceling WorldGenerationJobStatus = "Canceling" WorldGenerationJobStatusCanceled WorldGenerationJobStatus = "Canceled" ) // Values returns all known values for WorldGenerationJobStatus. 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 (WorldGenerationJobStatus) Values() []WorldGenerationJobStatus { return []WorldGenerationJobStatus{ "Pending", "Running", "Completed", "Failed", "PartialFailed", "Canceling", "Canceled", } }
603
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 failure percentage threshold percentage was met. type ConcurrentDeploymentException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConcurrentDeploymentException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConcurrentDeploymentException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConcurrentDeploymentException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConcurrentDeploymentException" } return *e.ErrorCodeOverride } func (e *ConcurrentDeploymentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request uses the same client token as a previous, but non-identical // request. Do not reuse a client token with different requests, unless the // requests are identical. type IdempotentParameterMismatchException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *IdempotentParameterMismatchException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *IdempotentParameterMismatchException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *IdempotentParameterMismatchException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "IdempotentParameterMismatchException" } return *e.ErrorCodeOverride } func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // AWS RoboMaker experienced a service issue. Try your call again. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // A parameter specified in a request is not valid, is unsupported, or cannot be // used. The returned message provides an explanation of the error value. type InvalidParameterException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidParameterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidParameterException" } return *e.ErrorCodeOverride } func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested resource exceeds the maximum number allowed, or the number of // concurrent stream requests exceeds the maximum number allowed. type LimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified resource already exists. type ResourceAlreadyExistsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceAlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceAlreadyExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceAlreadyExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceAlreadyExistsException" } return *e.ErrorCodeOverride } func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified resource does not exist. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request has failed due to a temporary failure of the server. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // AWS RoboMaker is temporarily unable to process the request. Try your call again. type ThrottlingException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
249
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // Information about the batch policy. type BatchPolicy struct { // The number of active simulation jobs create as part of the batch that can be in // an active state at the same time. Active states include: Pending , Preparing , // Running , Restarting , RunningFailed and Terminating . All other states are // terminal states. MaxConcurrency *int32 // The amount of time, in seconds, to wait for the batch to complete. If a batch // times out, and there are pending requests that were failing due to an internal // failure (like InternalServiceError ), they will be moved to the failed list and // the batch status will be Failed . If the pending requests were failing for any // other reason, the failed pending requests will be moved to the failed list and // the batch status will be TimedOut . TimeoutInSeconds *int64 noSmithyDocumentSerde } // Compute information for the simulation job. type Compute struct { // Compute type information for the simulation job. ComputeType ComputeType // Compute GPU unit limit for the simulation job. It is the same as the number of // GPUs allocated to the SimulationJob. GpuUnitLimit *int32 // The simulation unit limit. Your simulation is allocated CPU and memory // proportional to the supplied simulation unit limit. A simulation unit is 1 vcpu // and 2GB of memory. You are only billed for the SU utilization you consume up to // the maximum value provided. The default is 15. SimulationUnitLimit *int32 noSmithyDocumentSerde } // Compute information for the simulation job type ComputeResponse struct { // Compute type response information for the simulation job. ComputeType ComputeType // Compute GPU unit limit for the simulation job. It is the same as the number of // GPUs allocated to the SimulationJob. GpuUnitLimit *int32 // The simulation unit limit. Your simulation is allocated CPU and memory // proportional to the supplied simulation unit limit. A simulation unit is 1 vcpu // and 2GB of memory. You are only billed for the SU utilization you consume up to // the maximum value provided. The default is 15. SimulationUnitLimit *int32 noSmithyDocumentSerde } // Information about a data source. type DataSource struct { // The location where your files are mounted in the container image. If you've // specified the type of the data source as an Archive , you must provide an Amazon // S3 object key to your archive. The object key must point to either a .zip or // .tar.gz file. If you've specified the type of the data source as a Prefix , you // provide the Amazon S3 prefix that points to the files that you are using for // your data source. If you've specified the type of the data source as a File , // you provide the Amazon S3 path to the file that you're using as your data // source. Destination *string // The name of the data source. Name *string // The S3 bucket where the data files are located. S3Bucket *string // The list of S3 keys identifying the data source files. S3Keys []S3KeyOutput // The data type for the data source that you're using for your container image or // simulation job. You can use this field to specify whether your data source is an // Archive, an Amazon S3 prefix, or a file. If you don't specify a field, the // default value is File . Type DataSourceType noSmithyDocumentSerde } // Information about a data source. type DataSourceConfig struct { // The name of the data source. // // This member is required. Name *string // The S3 bucket where the data files are located. // // This member is required. S3Bucket *string // The list of S3 keys identifying the data source files. // // This member is required. S3Keys []string // The location where your files are mounted in the container image. If you've // specified the type of the data source as an Archive , you must provide an Amazon // S3 object key to your archive. The object key must point to either a .zip or // .tar.gz file. If you've specified the type of the data source as a Prefix , you // provide the Amazon S3 prefix that points to the files that you are using for // your data source. If you've specified the type of the data source as a File , // you provide the Amazon S3 path to the file that you're using as your data // source. Destination *string // The data type for the data source that you're using for your container image or // simulation job. You can use this field to specify whether your data source is an // Archive, an Amazon S3 prefix, or a file. If you don't specify a field, the // default value is File . Type DataSourceType noSmithyDocumentSerde } // Information about a deployment application configuration. type DeploymentApplicationConfig struct { // The Amazon Resource Name (ARN) of the robot application. // // This member is required. Application *string // The version of the application. // // This member is required. ApplicationVersion *string // The launch configuration. // // This member is required. LaunchConfig *DeploymentLaunchConfig noSmithyDocumentSerde } // Information about a deployment configuration. type DeploymentConfig struct { // The percentage of robots receiving the deployment at the same time. ConcurrentDeploymentPercentage *int32 // The download condition file. DownloadConditionFile *S3Object // The percentage of deployments that need to fail before stopping deployment. FailureThresholdPercentage *int32 // The amount of time, in seconds, to wait for deployment to a single robot to // complete. Choose a time between 1 minute and 7 days. The default is 5 hours. RobotDeploymentTimeoutInSeconds *int64 noSmithyDocumentSerde } // Information about a deployment job. type DeploymentJob struct { // The Amazon Resource Name (ARN) of the deployment job. Arn *string // The time, in milliseconds since the epoch, when the deployment job was created. CreatedAt *time.Time // The deployment application configuration. DeploymentApplicationConfigs []DeploymentApplicationConfig // The deployment configuration. DeploymentConfig *DeploymentConfig // The deployment job failure code. FailureCode DeploymentJobErrorCode // A short description of the reason why the deployment job failed. FailureReason *string // The Amazon Resource Name (ARN) of the fleet. Fleet *string // The status of the deployment job. Status DeploymentStatus noSmithyDocumentSerde } // Configuration information for a deployment launch. type DeploymentLaunchConfig struct { // The launch file name. // // This member is required. LaunchFile *string // The package name. // // This member is required. PackageName *string // An array of key/value pairs specifying environment variables for the robot // application EnvironmentVariables map[string]string // The deployment post-launch file. This file will be executed after the launch // file. PostLaunchFile *string // The deployment pre-launch file. This file will be executed prior to the launch // file. PreLaunchFile *string noSmithyDocumentSerde } // The object that contains the Docker image URI for either your robot or // simulation applications. type Environment struct { // The Docker image URI for either your robot or simulation applications. Uri *string noSmithyDocumentSerde } // Information about a failed create simulation job request. type FailedCreateSimulationJobRequest struct { // The time, in milliseconds since the epoch, when the simulation job batch failed. FailedAt *time.Time // The failure code. FailureCode SimulationJobErrorCode // The failure reason of the simulation job request. FailureReason *string // The simulation job request. Request *SimulationJobRequest noSmithyDocumentSerde } // Information about worlds that failed. type FailureSummary struct { // The worlds that failed. Failures []WorldFailure // The total number of failures. TotalFailureCount int32 noSmithyDocumentSerde } // Information about a filter. type Filter struct { // The name of the filter. Name *string // A list of values. Values []string noSmithyDocumentSerde } // Information about worlds that finished. type FinishedWorldsSummary struct { // Information about worlds that failed. FailureSummary *FailureSummary // The total number of finished worlds. FinishedCount int32 // A list of worlds that succeeded. SucceededWorlds []string noSmithyDocumentSerde } // Information about a fleet. type Fleet struct { // The Amazon Resource Name (ARN) of the fleet. Arn *string // The time, in milliseconds since the epoch, when the fleet was created. CreatedAt *time.Time // The Amazon Resource Name (ARN) of the last deployment job. LastDeploymentJob *string // The status of the last fleet deployment. LastDeploymentStatus DeploymentStatus // The time of the last deployment. LastDeploymentTime *time.Time // The name of the fleet. Name *string noSmithyDocumentSerde } // Information about a launch configuration. type LaunchConfig struct { // If you've specified General as the value for your RobotSoftwareSuite , you can // use this field to specify a list of commands for your container image. If you've // specified SimulationRuntime as the value for your SimulationSoftwareSuite , you // can use this field to specify a list of commands for your container image. Command []string // The environment variables for the application launch. EnvironmentVariables map[string]string // The launch file name. LaunchFile *string // The package name. PackageName *string // The port forwarding configuration. PortForwardingConfig *PortForwardingConfig // Boolean indicating whether a streaming session will be configured for the // application. If True , AWS RoboMaker will configure a connection so you can // interact with your application as it is running in the simulation. You must // configure and launch the component. It must have a graphical user interface. StreamUI bool noSmithyDocumentSerde } // The logging configuration. type LoggingConfig struct { // A boolean indicating whether to record all ROS topics. This API is no longer // supported and will throw an error if used. // // Deprecated: AWS RoboMaker is ending support for ROS software suite. For // additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/software-support-policy.html. RecordAllRosTopics *bool noSmithyDocumentSerde } // Describes a network interface. type NetworkInterface struct { // The ID of the network interface. NetworkInterfaceId *string // The IPv4 address of the network interface within the subnet. PrivateIpAddress *string // The IPv4 public address of the network interface. PublicIpAddress *string noSmithyDocumentSerde } // The output location. type OutputLocation struct { // The S3 bucket for output. S3Bucket *string // The S3 folder in the s3Bucket where output files will be placed. S3Prefix *string noSmithyDocumentSerde } // Configuration information for port forwarding. type PortForwardingConfig struct { // The port mappings for the configuration. PortMappings []PortMapping noSmithyDocumentSerde } // An object representing a port mapping. type PortMapping struct { // The port number on the application. // // This member is required. ApplicationPort int32 // The port number on the simulation job instance to use as a remote connection // point. // // This member is required. JobPort int32 // A Boolean indicating whether to enable this port mapping on public IP. EnableOnPublicIp bool noSmithyDocumentSerde } // Information about the progress of a deployment job. type ProgressDetail struct { // The current progress status. Validating Validating the deployment. // DownloadingExtracting Downloading and extracting the bundle on the robot. // ExecutingPreLaunch Executing pre-launch script(s) if provided. Launching // Launching the robot application. ExecutingPostLaunch Executing post-launch // script(s) if provided. Finished Deployment is complete. CurrentProgress RobotDeploymentStep // Estimated amount of time in seconds remaining in the step. This currently only // applies to the Downloading/Extracting step of the deployment. It is empty for // other steps. EstimatedTimeRemainingSeconds *int32 // Precentage of the step that is done. This currently only applies to the // Downloading/Extracting step of the deployment. It is empty for other steps. PercentDone *float32 // The Amazon Resource Name (ARN) of the deployment job. TargetResource *string noSmithyDocumentSerde } // Information about a rendering engine. type RenderingEngine struct { // The name of the rendering engine. Name RenderingEngineType // The version of the rendering engine. Version *string noSmithyDocumentSerde } // Information about a robot. type Robot struct { // The architecture of the robot. Architecture Architecture // The Amazon Resource Name (ARN) of the robot. Arn *string // The time, in milliseconds since the epoch, when the robot was created. CreatedAt *time.Time // The Amazon Resource Name (ARN) of the fleet. FleetArn *string // The Greengrass group associated with the robot. GreenGrassGroupId *string // The Amazon Resource Name (ARN) of the last deployment job. LastDeploymentJob *string // The time of the last deployment. LastDeploymentTime *time.Time // The name of the robot. Name *string // The status of the robot. Status RobotStatus noSmithyDocumentSerde } // Application configuration information for a robot. type RobotApplicationConfig struct { // The application information for the robot application. // // This member is required. Application *string // The launch configuration for the robot application. // // This member is required. LaunchConfig *LaunchConfig // The version of the robot application. ApplicationVersion *string // Information about tools configured for the robot application. Tools []Tool // The upload configurations for the robot application. UploadConfigurations []UploadConfiguration // A Boolean indicating whether to use default robot application tools. The // default tools are rviz, rqt, terminal and rosbag record. The default is False . // This API is no longer supported and will throw an error if used. // // Deprecated: AWS RoboMaker is ending support for ROS software suite. For // additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/software-support-policy.html. UseDefaultTools *bool // A Boolean indicating whether to use default upload configurations. By default, // .ros and .gazebo files are uploaded when the application terminates and all ROS // topics will be recorded. If you set this value, you must specify an // outputLocation . This API is no longer supported and will throw an error if used. // // Deprecated: AWS RoboMaker is ending support for ROS software suite. For // additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/software-support-policy.html. UseDefaultUploadConfigurations *bool noSmithyDocumentSerde } // Summary information for a robot application. type RobotApplicationSummary struct { // The Amazon Resource Name (ARN) of the robot. Arn *string // The time, in milliseconds since the epoch, when the robot application was last // updated. LastUpdatedAt *time.Time // The name of the robot application. Name *string // Information about a robot software suite (ROS distribution). RobotSoftwareSuite *RobotSoftwareSuite // The version of the robot application. Version *string noSmithyDocumentSerde } // Information about a robot deployment. type RobotDeployment struct { // The robot deployment Amazon Resource Name (ARN). Arn *string // The time, in milliseconds since the epoch, when the deployment finished. DeploymentFinishTime *time.Time // The time, in milliseconds since the epoch, when the deployment was started. DeploymentStartTime *time.Time // The robot deployment failure code. FailureCode DeploymentJobErrorCode // A short description of the reason why the robot deployment failed. FailureReason *string // Information about how the deployment is progressing. ProgressDetail *ProgressDetail // The status of the robot deployment. Status RobotStatus noSmithyDocumentSerde } // Information about a robot software suite (ROS distribution). type RobotSoftwareSuite struct { // The name of the robot software suite (ROS distribution). Name RobotSoftwareSuiteType // The version of the robot software suite (ROS distribution). Version RobotSoftwareSuiteVersionType noSmithyDocumentSerde } // Information about S3 keys. type S3KeyOutput struct { // The etag for the object. Etag *string // The S3 key. S3Key *string noSmithyDocumentSerde } // Information about an S3 object. type S3Object struct { // The bucket containing the object. // // This member is required. Bucket *string // The key of the object. // // This member is required. Key *string // The etag of the object. Etag *string noSmithyDocumentSerde } // Information about a simulation application configuration. type SimulationApplicationConfig struct { // The application information for the simulation application. // // This member is required. Application *string // The launch configuration for the simulation application. // // This member is required. LaunchConfig *LaunchConfig // The version of the simulation application. ApplicationVersion *string // Information about tools configured for the simulation application. Tools []Tool // Information about upload configurations for the simulation application. UploadConfigurations []UploadConfiguration // A Boolean indicating whether to use default simulation application tools. The // default tools are rviz, rqt, terminal and rosbag record. The default is False . // This API is no longer supported and will throw an error if used. // // Deprecated: AWS RoboMaker is ending support for ROS software suite. For // additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/software-support-policy.html. UseDefaultTools *bool // A Boolean indicating whether to use default upload configurations. By default, // .ros and .gazebo files are uploaded when the application terminates and all ROS // topics will be recorded. If you set this value, you must specify an // outputLocation . This API is no longer supported and will throw an error if used. // // Deprecated: AWS RoboMaker is ending support for ROS software suite. For // additional information, see // https://docs.aws.amazon.com/robomaker/latest/dg/software-support-policy.html. UseDefaultUploadConfigurations *bool // A list of world configurations. WorldConfigs []WorldConfig noSmithyDocumentSerde } // Summary information for a simulation application. type SimulationApplicationSummary struct { // The Amazon Resource Name (ARN) of the simulation application. Arn *string // The time, in milliseconds since the epoch, when the simulation application was // last updated. LastUpdatedAt *time.Time // The name of the simulation application. Name *string // Information about a robot software suite (ROS distribution). RobotSoftwareSuite *RobotSoftwareSuite // Information about a simulation software suite. SimulationSoftwareSuite *SimulationSoftwareSuite // The version of the simulation application. Version *string noSmithyDocumentSerde } // Information about a simulation job. type SimulationJob struct { // The Amazon Resource Name (ARN) of the simulation job. Arn *string // A unique identifier for this SimulationJob request. ClientRequestToken *string // Compute information for the simulation job Compute *ComputeResponse // The data sources for the simulation job. DataSources []DataSource // The failure behavior the simulation job. Continue Leaves the host running for // its maximum timeout duration after a 4XX error code. Fail Stop the simulation // job and terminate the instance. FailureBehavior FailureBehavior // The failure code of the simulation job if it failed. FailureCode SimulationJobErrorCode // The reason why the simulation job failed. FailureReason *string // The IAM role that allows the simulation instance to call the AWS APIs that are // specified in its associated policies on your behalf. This is how credentials are // passed in to your simulation job. IamRole *string // The time, in milliseconds since the epoch, when the simulation job was last // started. LastStartedAt *time.Time // The time, in milliseconds since the epoch, when the simulation job was last // updated. LastUpdatedAt *time.Time // The logging configuration. LoggingConfig *LoggingConfig // The maximum simulation job duration in seconds. The value must be 8 days // (691,200 seconds) or less. MaxJobDurationInSeconds int64 // The name of the simulation job. Name *string // Information about a network interface. NetworkInterface *NetworkInterface // Location for output files generated by the simulation job. OutputLocation *OutputLocation // A list of robot applications. RobotApplications []RobotApplicationConfig // A list of simulation applications. SimulationApplications []SimulationApplicationConfig // The simulation job execution duration in milliseconds. SimulationTimeMillis int64 // Status of the simulation job. Status SimulationJobStatus // A map that contains tag keys and tag values that are attached to the simulation // job. Tags map[string]string // VPC configuration information. VpcConfig *VPCConfigResponse noSmithyDocumentSerde } // Information about a simulation job batch. type SimulationJobBatchSummary struct { // The Amazon Resource Name (ARN) of the batch. Arn *string // The time, in milliseconds since the epoch, when the simulation job batch was // created. CreatedAt *time.Time // The number of created simulation job requests. CreatedRequestCount int32 // The number of failed simulation job requests. FailedRequestCount int32 // The time, in milliseconds since the epoch, when the simulation job batch was // last updated. LastUpdatedAt *time.Time // The number of pending simulation job requests. PendingRequestCount int32 // The status of the simulation job batch. Pending The simulation job batch // request is pending. InProgress The simulation job batch is in progress. Failed // The simulation job batch failed. One or more simulation job requests could not // be completed due to an internal failure (like InternalServiceError ). See // failureCode and failureReason for more information. Completed The simulation // batch job completed. A batch is complete when (1) there are no pending // simulation job requests in the batch and none of the failed simulation job // requests are due to InternalServiceError and (2) when all created simulation // jobs have reached a terminal state (for example, Completed or Failed ). Canceled // The simulation batch job was cancelled. Canceling The simulation batch job is // being cancelled. Completing The simulation batch job is completing. TimingOut // The simulation job batch is timing out. If a batch timing out, and there are // pending requests that were failing due to an internal failure (like // InternalServiceError ), the batch status will be Failed . If there are no such // failing request, the batch status will be TimedOut . TimedOut The simulation // batch job timed out. Status SimulationJobBatchStatus noSmithyDocumentSerde } // Information about a simulation job request. type SimulationJobRequest struct { // The maximum simulation job duration in seconds. The value must be 8 days // (691,200 seconds) or less. // // This member is required. MaxJobDurationInSeconds int64 // Compute information for the simulation job Compute *Compute // Specify data sources to mount read-only files from S3 into your simulation. // These files are available under /opt/robomaker/datasources/data_source_name . // There is a limit of 100 files and a combined size of 25GB for all // DataSourceConfig objects. DataSources []DataSourceConfig // The failure behavior the simulation job. Continue Leaves the host running for // its maximum timeout duration after a 4XX error code. Fail Stop the simulation // job and terminate the instance. FailureBehavior FailureBehavior // The IAM role name that allows the simulation instance to call the AWS APIs that // are specified in its associated policies on your behalf. This is how credentials // are passed in to your simulation job. IamRole *string // The logging configuration. LoggingConfig *LoggingConfig // The output location. OutputLocation *OutputLocation // The robot applications to use in the simulation job. RobotApplications []RobotApplicationConfig // The simulation applications to use in the simulation job. SimulationApplications []SimulationApplicationConfig // A map that contains tag keys and tag values that are attached to the simulation // job request. Tags map[string]string // A Boolean indicating whether to use default applications in the simulation job. // Default applications include Gazebo, rqt, rviz and terminal access. UseDefaultApplications *bool // If your simulation job accesses resources in a VPC, you provide this parameter // identifying the list of security group IDs and subnet IDs. These must belong to // the same VPC. You must provide at least one security group and two subnet IDs. VpcConfig *VPCConfig noSmithyDocumentSerde } // Summary information for a simulation job. type SimulationJobSummary struct { // The Amazon Resource Name (ARN) of the simulation job. Arn *string // The compute type for the simulation job summary. ComputeType ComputeType // The names of the data sources. DataSourceNames []string // The time, in milliseconds since the epoch, when the simulation job was last // updated. LastUpdatedAt *time.Time // The name of the simulation job. Name *string // A list of simulation job robot application names. RobotApplicationNames []string // A list of simulation job simulation application names. SimulationApplicationNames []string // The status of the simulation job. Status SimulationJobStatus noSmithyDocumentSerde } // Information about a simulation software suite. type SimulationSoftwareSuite struct { // The name of the simulation software suite. Name SimulationSoftwareSuiteType // The version of the simulation software suite. Version *string noSmithyDocumentSerde } // Information about a source. type Source struct { // The taget processor architecture for the application. Architecture Architecture // A hash of the object specified by s3Bucket and s3Key . Etag *string // The s3 bucket name. S3Bucket *string // The s3 object key. S3Key *string noSmithyDocumentSerde } // Information about a source configuration. type SourceConfig struct { // The target processor architecture for the application. Architecture Architecture // The Amazon S3 bucket name. S3Bucket *string // The s3 object key. S3Key *string noSmithyDocumentSerde } // Information about a template location. type TemplateLocation struct { // The Amazon S3 bucket name. // // This member is required. S3Bucket *string // The list of S3 keys identifying the data source files. // // This member is required. S3Key *string noSmithyDocumentSerde } // Summary information for a template. type TemplateSummary struct { // The Amazon Resource Name (ARN) of the template. Arn *string // The time, in milliseconds since the epoch, when the template was created. CreatedAt *time.Time // The time, in milliseconds since the epoch, when the template was last updated. LastUpdatedAt *time.Time // The name of the template. Name *string // The version of the template that you're using. Version *string noSmithyDocumentSerde } // Information about a tool. Tools are used in a simulation job. type Tool struct { // Command-line arguments for the tool. It must include the tool executable name. // // This member is required. Command *string // The name of the tool. // // This member is required. Name *string // Exit behavior determines what happens when your tool quits running. RESTART // will cause your tool to be restarted. FAIL will cause your job to exit. The // default is RESTART . ExitBehavior ExitBehavior // Boolean indicating whether logs will be recorded in CloudWatch for the tool. // The default is False . StreamOutputToCloudWatch *bool // Boolean indicating whether a streaming session will be configured for the tool. // If True , AWS RoboMaker will configure a connection so you can interact with the // tool as it is running in the simulation. It must have a graphical user // interface. The default is False . StreamUI *bool noSmithyDocumentSerde } // Provides upload configuration information. Files are uploaded from the // simulation job to a location you specify. type UploadConfiguration struct { // A prefix that specifies where files will be uploaded in Amazon S3. It is // appended to the simulation output location to determine the final path. For // example, if your simulation output location is s3://my-bucket and your upload // configuration name is robot-test , your files will be uploaded to // s3://my-bucket///robot-test . // // This member is required. Name *string // Specifies the path of the file(s) to upload. Standard Unix glob matching rules // are accepted, with the addition of ** as a super asterisk. For example, // specifying /var/log/**.log causes all .log files in the /var/log directory tree // to be collected. For more examples, see Glob Library (https://github.com/gobwas/glob) // . // // This member is required. Path *string // Specifies when to upload the files: UPLOAD_ON_TERMINATE Matching files are // uploaded once the simulation enters the TERMINATING state. Matching files are // not uploaded until all of your code (including tools) have stopped. If there is // a problem uploading a file, the upload is retried. If problems persist, no // further upload attempts will be made. UPLOAD_ROLLING_AUTO_REMOVE Matching files // are uploaded as they are created. They are deleted after they are uploaded. The // specified path is checked every 5 seconds. A final check is made when all of // your code (including tools) have stopped. // // This member is required. UploadBehavior UploadBehavior noSmithyDocumentSerde } // If your simulation job accesses resources in a VPC, you provide this parameter // identifying the list of security group IDs and subnet IDs. These must belong to // the same VPC. You must provide at least one security group and two subnet IDs. type VPCConfig struct { // A list of one or more subnet IDs in your VPC. // // This member is required. Subnets []string // A boolean indicating whether to assign a public IP address. AssignPublicIp bool // A list of one or more security groups IDs in your VPC. SecurityGroups []string noSmithyDocumentSerde } // VPC configuration associated with your simulation job. type VPCConfigResponse struct { // A boolean indicating if a public IP was assigned. AssignPublicIp bool // A list of security group IDs associated with the simulation job. SecurityGroups []string // A list of subnet IDs associated with the simulation job. Subnets []string // The VPC ID associated with your simulation job. VpcId *string noSmithyDocumentSerde } // Configuration information for a world. type WorldConfig struct { // The world generated by Simulation WorldForge. World *string noSmithyDocumentSerde } // The number of worlds that will be created. You can configure the number of // unique floorplans and the number of unique interiors for each floor plan. For // example, if you want 1 world with 20 unique interiors, you set floorplanCount = // 1 and interiorCountPerFloorplan = 20 . This will result in 20 worlds ( // floorplanCount * interiorCountPerFloorplan) . If you set floorplanCount = 4 and // interiorCountPerFloorplan = 5 , there will be 20 worlds with 5 unique floor // plans. type WorldCount struct { // The number of unique floorplans. FloorplanCount *int32 // The number of unique interiors per floorplan. InteriorCountPerFloorplan *int32 noSmithyDocumentSerde } // Information about a world export job. type WorldExportJobSummary struct { // The Amazon Resource Name (ARN) of the world export job. Arn *string // The time, in milliseconds since the epoch, when the world export job was // created. CreatedAt *time.Time // The output location. OutputLocation *OutputLocation // The status of the world export job. Pending The world export job request is // pending. Running The world export job is running. Completed The world export job // completed. Failed The world export job failed. See failureCode for more // information. Canceled The world export job was cancelled. Canceling The world // export job is being cancelled. Status WorldExportJobStatus // A list of worlds. Worlds []string noSmithyDocumentSerde } // Information about a failed world. type WorldFailure struct { // The failure code of the world export job if it failed: InternalServiceError // Internal service error. LimitExceeded The requested resource exceeds the maximum // number allowed, or the number of concurrent stream requests exceeds the maximum // number allowed. ResourceNotFound The specified resource could not be found. // RequestThrottled The request was throttled. InvalidInput An input parameter in // the request is not valid. FailureCode WorldGenerationJobErrorCode // The number of failed worlds. FailureCount int32 // The sample reason why the world failed. World errors are aggregated. A sample // is used as the sampleFailureReason . SampleFailureReason *string noSmithyDocumentSerde } // Information about a world generator job. type WorldGenerationJobSummary struct { // The Amazon Resource Name (ARN) of the world generator job. Arn *string // The time, in milliseconds since the epoch, when the world generator job was // created. CreatedAt *time.Time // The number of worlds that failed. FailedWorldCount int32 // The status of the world generator job: Pending The world generator job request // is pending. Running The world generator job is running. Completed The world // generator job completed. Failed The world generator job failed. See failureCode // for more information. PartialFailed Some worlds did not generate. Canceled The // world generator job was cancelled. Canceling The world generator job is being // cancelled. Status WorldGenerationJobStatus // The number of worlds that were generated. SucceededWorldCount int32 // The Amazon Resource Name (arn) of the world template. Template *string // Information about the world count. WorldCount *WorldCount noSmithyDocumentSerde } // Information about a world. type WorldSummary struct { // The Amazon Resource Name (ARN) of the world. Arn *string // The time, in milliseconds since the epoch, when the world was created. CreatedAt *time.Time // The Amazon Resource Name (arn) of the world generation job. GenerationJob *string // The Amazon Resource Name (arn) of the world template. Template *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
1,224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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 = "RolesAnywhere" const ServiceAPIVersion = "2018-05-10" // Client provides the API client to make operations call for IAM Roles Anywhere. 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, "rolesanywhere", 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 rolesanywhere 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 rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a profile, a list of the roles that Roles Anywhere service is trusted // to assume. You use profiles to intersect permissions with IAM managed policies. // Required permissions: rolesanywhere:CreateProfile . func (c *Client) CreateProfile(ctx context.Context, params *CreateProfileInput, optFns ...func(*Options)) (*CreateProfileOutput, error) { if params == nil { params = &CreateProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateProfile", params, optFns, c.addOperationCreateProfileMiddlewares) if err != nil { return nil, err } out := result.(*CreateProfileOutput) out.ResultMetadata = metadata return out, nil } type CreateProfileInput struct { // The name of the profile. // // This member is required. Name *string // A list of IAM roles that this profile can assume in a temporary credential // request. // // This member is required. RoleArns []string // The number of seconds the vended session credentials are valid for. DurationSeconds *int32 // Specifies whether the profile is enabled. Enabled *bool // A list of managed policy ARNs that apply to the vended session credentials. ManagedPolicyArns []string // Specifies whether instance properties are required in temporary credential // requests with this profile. RequireInstanceProperties *bool // A session policy that applies to the trust boundary of the vended session // credentials. SessionPolicy *string // The tags to attach to the profile. Tags []types.Tag noSmithyDocumentSerde } type CreateProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "CreateProfile", } }
153
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a trust anchor to establish trust between IAM Roles Anywhere and your // certificate authority (CA). You can define a trust anchor as a reference to an // Private Certificate Authority (Private CA) or by uploading a CA certificate. // Your Amazon Web Services workloads can authenticate with the trust anchor using // certificates issued by the CA in exchange for temporary Amazon Web Services // credentials. Required permissions: rolesanywhere:CreateTrustAnchor . func (c *Client) CreateTrustAnchor(ctx context.Context, params *CreateTrustAnchorInput, optFns ...func(*Options)) (*CreateTrustAnchorOutput, error) { if params == nil { params = &CreateTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateTrustAnchor", params, optFns, c.addOperationCreateTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*CreateTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type CreateTrustAnchorInput struct { // The name of the trust anchor. // // This member is required. Name *string // The trust anchor type and its related certificate data. // // This member is required. Source *types.Source // Specifies whether the trust anchor is enabled. Enabled *bool // A list of notification settings to be associated to the trust anchor. NotificationSettings []types.NotificationSetting // The tags to attach to the trust anchor. Tags []types.Tag noSmithyDocumentSerde } type CreateTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "CreateTrustAnchor", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a certificate revocation list (CRL). Required permissions: // rolesanywhere:DeleteCrl . func (c *Client) DeleteCrl(ctx context.Context, params *DeleteCrlInput, optFns ...func(*Options)) (*DeleteCrlOutput, error) { if params == nil { params = &DeleteCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCrl", params, optFns, c.addOperationDeleteCrlMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCrlOutput) out.ResultMetadata = metadata return out, nil } type DeleteCrlInput struct { // The unique identifier of the certificate revocation list (CRL). // // This member is required. CrlId *string noSmithyDocumentSerde } type DeleteCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DeleteCrl", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a profile. Required permissions: rolesanywhere:DeleteProfile . func (c *Client) DeleteProfile(ctx context.Context, params *DeleteProfileInput, optFns ...func(*Options)) (*DeleteProfileOutput, error) { if params == nil { params = &DeleteProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteProfile", params, optFns, c.addOperationDeleteProfileMiddlewares) if err != nil { return nil, err } out := result.(*DeleteProfileOutput) out.ResultMetadata = metadata return out, nil } type DeleteProfileInput struct { // The unique identifier of the profile. // // This member is required. ProfileId *string noSmithyDocumentSerde } type DeleteProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DeleteProfile", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a trust anchor. Required permissions: rolesanywhere:DeleteTrustAnchor . func (c *Client) DeleteTrustAnchor(ctx context.Context, params *DeleteTrustAnchorInput, optFns ...func(*Options)) (*DeleteTrustAnchorOutput, error) { if params == nil { params = &DeleteTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteTrustAnchor", params, optFns, c.addOperationDeleteTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*DeleteTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type DeleteTrustAnchorInput struct { // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type DeleteTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DeleteTrustAnchor", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables a certificate revocation list (CRL). Required permissions: // rolesanywhere:DisableCrl . func (c *Client) DisableCrl(ctx context.Context, params *DisableCrlInput, optFns ...func(*Options)) (*DisableCrlOutput, error) { if params == nil { params = &DisableCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableCrl", params, optFns, c.addOperationDisableCrlMiddlewares) if err != nil { return nil, err } out := result.(*DisableCrlOutput) out.ResultMetadata = metadata return out, nil } type DisableCrlInput struct { // The unique identifier of the certificate revocation list (CRL). // // This member is required. CrlId *string noSmithyDocumentSerde } type DisableCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisableCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisableCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DisableCrl", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables a profile. When disabled, temporary credential requests with this // profile fail. Required permissions: rolesanywhere:DisableProfile . func (c *Client) DisableProfile(ctx context.Context, params *DisableProfileInput, optFns ...func(*Options)) (*DisableProfileOutput, error) { if params == nil { params = &DisableProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableProfile", params, optFns, c.addOperationDisableProfileMiddlewares) if err != nil { return nil, err } out := result.(*DisableProfileOutput) out.ResultMetadata = metadata return out, nil } type DisableProfileInput struct { // The unique identifier of the profile. // // This member is required. ProfileId *string noSmithyDocumentSerde } type DisableProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisableProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisableProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DisableProfile", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables a trust anchor. When disabled, temporary credential requests // specifying this trust anchor are unauthorized. Required permissions: // rolesanywhere:DisableTrustAnchor . func (c *Client) DisableTrustAnchor(ctx context.Context, params *DisableTrustAnchorInput, optFns ...func(*Options)) (*DisableTrustAnchorOutput, error) { if params == nil { params = &DisableTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableTrustAnchor", params, optFns, c.addOperationDisableTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*DisableTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type DisableTrustAnchorInput struct { // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type DisableTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisableTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisableTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "DisableTrustAnchor", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables a certificate revocation list (CRL). When enabled, certificates stored // in the CRL are unauthorized to receive session credentials. Required // permissions: rolesanywhere:EnableCrl . func (c *Client) EnableCrl(ctx context.Context, params *EnableCrlInput, optFns ...func(*Options)) (*EnableCrlOutput, error) { if params == nil { params = &EnableCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableCrl", params, optFns, c.addOperationEnableCrlMiddlewares) if err != nil { return nil, err } out := result.(*EnableCrlOutput) out.ResultMetadata = metadata return out, nil } type EnableCrlInput struct { // The unique identifier of the certificate revocation list (CRL). // // This member is required. CrlId *string noSmithyDocumentSerde } type EnableCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpEnableCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnableCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "EnableCrl", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables temporary credential requests for a profile. Required permissions: // rolesanywhere:EnableProfile . func (c *Client) EnableProfile(ctx context.Context, params *EnableProfileInput, optFns ...func(*Options)) (*EnableProfileOutput, error) { if params == nil { params = &EnableProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableProfile", params, optFns, c.addOperationEnableProfileMiddlewares) if err != nil { return nil, err } out := result.(*EnableProfileOutput) out.ResultMetadata = metadata return out, nil } type EnableProfileInput struct { // The unique identifier of the profile. // // This member is required. ProfileId *string noSmithyDocumentSerde } type EnableProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpEnableProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnableProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "EnableProfile", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables a trust anchor. When enabled, certificates in the trust anchor chain // are authorized for trust validation. Required permissions: // rolesanywhere:EnableTrustAnchor . func (c *Client) EnableTrustAnchor(ctx context.Context, params *EnableTrustAnchorInput, optFns ...func(*Options)) (*EnableTrustAnchorOutput, error) { if params == nil { params = &EnableTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableTrustAnchor", params, optFns, c.addOperationEnableTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*EnableTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type EnableTrustAnchorInput struct { // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type EnableTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpEnableTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnableTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "EnableTrustAnchor", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a certificate revocation list (CRL). Required permissions: // rolesanywhere:GetCrl . func (c *Client) GetCrl(ctx context.Context, params *GetCrlInput, optFns ...func(*Options)) (*GetCrlOutput, error) { if params == nil { params = &GetCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCrl", params, optFns, c.addOperationGetCrlMiddlewares) if err != nil { return nil, err } out := result.(*GetCrlOutput) out.ResultMetadata = metadata return out, nil } type GetCrlInput struct { // The unique identifier of the certificate revocation list (CRL). // // This member is required. CrlId *string noSmithyDocumentSerde } type GetCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "GetCrl", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a profile. Required permissions: rolesanywhere:GetProfile . func (c *Client) GetProfile(ctx context.Context, params *GetProfileInput, optFns ...func(*Options)) (*GetProfileOutput, error) { if params == nil { params = &GetProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "GetProfile", params, optFns, c.addOperationGetProfileMiddlewares) if err != nil { return nil, err } out := result.(*GetProfileOutput) out.ResultMetadata = metadata return out, nil } type GetProfileInput struct { // The unique identifier of the profile. // // This member is required. ProfileId *string noSmithyDocumentSerde } type GetProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "GetProfile", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a subject, which associates a certificate identity with authentication // attempts. The subject stores auditing information such as the status of the last // authentication attempt, the certificate data used in the attempt, and the last // time the associated identity attempted authentication. Required permissions: // rolesanywhere:GetSubject . func (c *Client) GetSubject(ctx context.Context, params *GetSubjectInput, optFns ...func(*Options)) (*GetSubjectOutput, error) { if params == nil { params = &GetSubjectInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSubject", params, optFns, c.addOperationGetSubjectMiddlewares) if err != nil { return nil, err } out := result.(*GetSubjectOutput) out.ResultMetadata = metadata return out, nil } type GetSubjectInput struct { // The unique identifier of the subject. // // This member is required. SubjectId *string noSmithyDocumentSerde } type GetSubjectOutput struct { // The state of the subject after a read or write operation. Subject *types.SubjectDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSubjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSubject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSubject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetSubjectValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSubject(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetSubject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "GetSubject", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets a trust anchor. Required permissions: rolesanywhere:GetTrustAnchor . func (c *Client) GetTrustAnchor(ctx context.Context, params *GetTrustAnchorInput, optFns ...func(*Options)) (*GetTrustAnchorOutput, error) { if params == nil { params = &GetTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "GetTrustAnchor", params, optFns, c.addOperationGetTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*GetTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type GetTrustAnchorInput struct { // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type GetTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "GetTrustAnchor", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Imports the certificate revocation list (CRL). A CRL is a list of certificates // that have been revoked by the issuing certificate Authority (CA). IAM Roles // Anywhere validates against the CRL before issuing credentials. Required // permissions: rolesanywhere:ImportCrl . func (c *Client) ImportCrl(ctx context.Context, params *ImportCrlInput, optFns ...func(*Options)) (*ImportCrlOutput, error) { if params == nil { params = &ImportCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportCrl", params, optFns, c.addOperationImportCrlMiddlewares) if err != nil { return nil, err } out := result.(*ImportCrlOutput) out.ResultMetadata = metadata return out, nil } type ImportCrlInput struct { // The x509 v3 specified certificate revocation list (CRL). // // This member is required. CrlData []byte // The name of the certificate revocation list (CRL). // // This member is required. Name *string // The ARN of the TrustAnchor the certificate revocation list (CRL) will provide // revocation for. // // This member is required. TrustAnchorArn *string // Specifies whether the certificate revocation list (CRL) is enabled. Enabled *bool // A list of tags to attach to the certificate revocation list (CRL). Tags []types.Tag noSmithyDocumentSerde } type ImportCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpImportCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpImportCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ImportCrl", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all certificate revocation lists (CRL) in the authenticated account and // Amazon Web Services Region. Required permissions: rolesanywhere:ListCrls . func (c *Client) ListCrls(ctx context.Context, params *ListCrlsInput, optFns ...func(*Options)) (*ListCrlsOutput, error) { if params == nil { params = &ListCrlsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCrls", params, optFns, c.addOperationListCrlsMiddlewares) if err != nil { return nil, err } out := result.(*ListCrlsOutput) out.ResultMetadata = metadata return out, nil } type ListCrlsInput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // The number of resources in the paginated list. PageSize *int32 noSmithyDocumentSerde } type ListCrlsOutput struct { // A list of certificate revocation lists (CRL). Crls []types.CrlDetail // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCrlsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListCrls{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCrls{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListCrls(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCrlsAPIClient is a client that implements the ListCrls operation. type ListCrlsAPIClient interface { ListCrls(context.Context, *ListCrlsInput, ...func(*Options)) (*ListCrlsOutput, error) } var _ ListCrlsAPIClient = (*Client)(nil) // ListCrlsPaginatorOptions is the paginator options for ListCrls type ListCrlsPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCrlsPaginator is a paginator for ListCrls type ListCrlsPaginator struct { options ListCrlsPaginatorOptions client ListCrlsAPIClient params *ListCrlsInput nextToken *string firstPage bool } // NewListCrlsPaginator returns a new ListCrlsPaginator func NewListCrlsPaginator(client ListCrlsAPIClient, params *ListCrlsInput, optFns ...func(*ListCrlsPaginatorOptions)) *ListCrlsPaginator { if params == nil { params = &ListCrlsInput{} } options := ListCrlsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListCrlsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCrlsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCrls page. func (p *ListCrlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrlsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListCrls(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListCrls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ListCrls", } }
209
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all profiles in the authenticated account and Amazon Web Services Region. // Required permissions: rolesanywhere:ListProfiles . func (c *Client) ListProfiles(ctx context.Context, params *ListProfilesInput, optFns ...func(*Options)) (*ListProfilesOutput, error) { if params == nil { params = &ListProfilesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProfiles", params, optFns, c.addOperationListProfilesMiddlewares) if err != nil { return nil, err } out := result.(*ListProfilesOutput) out.ResultMetadata = metadata return out, nil } type ListProfilesInput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // The number of resources in the paginated list. PageSize *int32 noSmithyDocumentSerde } type ListProfilesOutput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // A list of profiles. Profiles []types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfiles{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfiles{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProfiles(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListProfilesAPIClient is a client that implements the ListProfiles operation. type ListProfilesAPIClient interface { ListProfiles(context.Context, *ListProfilesInput, ...func(*Options)) (*ListProfilesOutput, error) } var _ ListProfilesAPIClient = (*Client)(nil) // ListProfilesPaginatorOptions is the paginator options for ListProfiles type ListProfilesPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListProfilesPaginator is a paginator for ListProfiles type ListProfilesPaginator struct { options ListProfilesPaginatorOptions client ListProfilesAPIClient params *ListProfilesInput nextToken *string firstPage bool } // NewListProfilesPaginator returns a new ListProfilesPaginator func NewListProfilesPaginator(client ListProfilesAPIClient, params *ListProfilesInput, optFns ...func(*ListProfilesPaginatorOptions)) *ListProfilesPaginator { if params == nil { params = &ListProfilesInput{} } options := ListProfilesPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListProfilesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProfilesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProfiles page. func (p *ListProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfilesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListProfiles(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ListProfiles", } }
209
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the subjects in the authenticated account and Amazon Web Services Region. // Required permissions: rolesanywhere:ListSubjects . func (c *Client) ListSubjects(ctx context.Context, params *ListSubjectsInput, optFns ...func(*Options)) (*ListSubjectsOutput, error) { if params == nil { params = &ListSubjectsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSubjects", params, optFns, c.addOperationListSubjectsMiddlewares) if err != nil { return nil, err } out := result.(*ListSubjectsOutput) out.ResultMetadata = metadata return out, nil } type ListSubjectsInput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // The number of resources in the paginated list. PageSize *int32 noSmithyDocumentSerde } type ListSubjectsOutput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // A list of subjects. Subjects []types.SubjectSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSubjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSubjects{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSubjects{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSubjects(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSubjectsAPIClient is a client that implements the ListSubjects operation. type ListSubjectsAPIClient interface { ListSubjects(context.Context, *ListSubjectsInput, ...func(*Options)) (*ListSubjectsOutput, error) } var _ ListSubjectsAPIClient = (*Client)(nil) // ListSubjectsPaginatorOptions is the paginator options for ListSubjects type ListSubjectsPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListSubjectsPaginator is a paginator for ListSubjects type ListSubjectsPaginator struct { options ListSubjectsPaginatorOptions client ListSubjectsAPIClient params *ListSubjectsInput nextToken *string firstPage bool } // NewListSubjectsPaginator returns a new ListSubjectsPaginator func NewListSubjectsPaginator(client ListSubjectsAPIClient, params *ListSubjectsInput, optFns ...func(*ListSubjectsPaginatorOptions)) *ListSubjectsPaginator { if params == nil { params = &ListSubjectsInput{} } options := ListSubjectsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListSubjectsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSubjectsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSubjects page. func (p *ListSubjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubjectsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListSubjects(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSubjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ListSubjects", } }
209
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the tags attached to the resource. Required permissions: // rolesanywhere:ListTagsForResource . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The ARN of the resource. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // A list of tags attached to the resource. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&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: "rolesanywhere", OperationName: "ListTagsForResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the trust anchors in the authenticated account and Amazon Web Services // Region. Required permissions: rolesanywhere:ListTrustAnchors . func (c *Client) ListTrustAnchors(ctx context.Context, params *ListTrustAnchorsInput, optFns ...func(*Options)) (*ListTrustAnchorsOutput, error) { if params == nil { params = &ListTrustAnchorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTrustAnchors", params, optFns, c.addOperationListTrustAnchorsMiddlewares) if err != nil { return nil, err } out := result.(*ListTrustAnchorsOutput) out.ResultMetadata = metadata return out, nil } type ListTrustAnchorsInput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // The number of resources in the paginated list. PageSize *int32 noSmithyDocumentSerde } type ListTrustAnchorsOutput struct { // A token that indicates where the output should continue from, if a previous // request did not show all results. To get the next results, make the request // again with this value. NextToken *string // A list of trust anchors. TrustAnchors []types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTrustAnchorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTrustAnchors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTrustAnchors{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListTrustAnchors(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListTrustAnchorsAPIClient is a client that implements the ListTrustAnchors // operation. type ListTrustAnchorsAPIClient interface { ListTrustAnchors(context.Context, *ListTrustAnchorsInput, ...func(*Options)) (*ListTrustAnchorsOutput, error) } var _ ListTrustAnchorsAPIClient = (*Client)(nil) // ListTrustAnchorsPaginatorOptions is the paginator options for ListTrustAnchors type ListTrustAnchorsPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListTrustAnchorsPaginator is a paginator for ListTrustAnchors type ListTrustAnchorsPaginator struct { options ListTrustAnchorsPaginatorOptions client ListTrustAnchorsAPIClient params *ListTrustAnchorsInput nextToken *string firstPage bool } // NewListTrustAnchorsPaginator returns a new ListTrustAnchorsPaginator func NewListTrustAnchorsPaginator(client ListTrustAnchorsAPIClient, params *ListTrustAnchorsInput, optFns ...func(*ListTrustAnchorsPaginatorOptions)) *ListTrustAnchorsPaginator { if params == nil { params = &ListTrustAnchorsInput{} } options := ListTrustAnchorsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListTrustAnchorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTrustAnchorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTrustAnchors page. func (p *ListTrustAnchorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrustAnchorsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListTrustAnchors(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListTrustAnchors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ListTrustAnchors", } }
210
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches a list of notification settings to a trust anchor. A notification // setting includes information such as event name, threshold, status of the // notification setting, and the channel to notify. Required permissions: // rolesanywhere:PutNotificationSettings . func (c *Client) PutNotificationSettings(ctx context.Context, params *PutNotificationSettingsInput, optFns ...func(*Options)) (*PutNotificationSettingsOutput, error) { if params == nil { params = &PutNotificationSettingsInput{} } result, metadata, err := c.invokeOperation(ctx, "PutNotificationSettings", params, optFns, c.addOperationPutNotificationSettingsMiddlewares) if err != nil { return nil, err } out := result.(*PutNotificationSettingsOutput) out.ResultMetadata = metadata return out, nil } type PutNotificationSettingsInput struct { // A list of notification settings to be associated to the trust anchor. // // This member is required. NotificationSettings []types.NotificationSetting // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type PutNotificationSettingsOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutNotificationSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutNotificationSettings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutNotificationSettings{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutNotificationSettingsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutNotificationSettings(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPutNotificationSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "PutNotificationSettings", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Resets the custom notification setting to IAM Roles Anywhere default setting. // Required permissions: rolesanywhere:ResetNotificationSettings . func (c *Client) ResetNotificationSettings(ctx context.Context, params *ResetNotificationSettingsInput, optFns ...func(*Options)) (*ResetNotificationSettingsOutput, error) { if params == nil { params = &ResetNotificationSettingsInput{} } result, metadata, err := c.invokeOperation(ctx, "ResetNotificationSettings", params, optFns, c.addOperationResetNotificationSettingsMiddlewares) if err != nil { return nil, err } out := result.(*ResetNotificationSettingsOutput) out.ResultMetadata = metadata return out, nil } type ResetNotificationSettingsInput struct { // A list of notification setting keys to reset. A notification setting key // includes the event and the channel. // // This member is required. NotificationSettingKeys []types.NotificationSettingKey // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string noSmithyDocumentSerde } type ResetNotificationSettingsOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationResetNotificationSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpResetNotificationSettings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResetNotificationSettings{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpResetNotificationSettingsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetNotificationSettings(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opResetNotificationSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "ResetNotificationSettings", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches tags to a resource. Required permissions: rolesanywhere:TagResource . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The ARN of the resource. // // This member is required. ResourceArn *string // The tags to attach 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(&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: "rolesanywhere", OperationName: "TagResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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 the resource. Required permissions: // rolesanywhere:UntagResource . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The ARN of the resource. // // This member is required. ResourceArn *string // A list of keys. Tag keys are the unique identifiers of tags. // // 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: "rolesanywhere", OperationName: "UntagResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the certificate revocation list (CRL). A CRL is a list of certificates // that have been revoked by the issuing certificate authority (CA). IAM Roles // Anywhere validates against the CRL before issuing credentials. Required // permissions: rolesanywhere:UpdateCrl . func (c *Client) UpdateCrl(ctx context.Context, params *UpdateCrlInput, optFns ...func(*Options)) (*UpdateCrlOutput, error) { if params == nil { params = &UpdateCrlInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateCrl", params, optFns, c.addOperationUpdateCrlMiddlewares) if err != nil { return nil, err } out := result.(*UpdateCrlOutput) out.ResultMetadata = metadata return out, nil } type UpdateCrlInput struct { // The unique identifier of the certificate revocation list (CRL). // // This member is required. CrlId *string // The x509 v3 specified certificate revocation list (CRL). CrlData []byte // The name of the Crl. Name *string noSmithyDocumentSerde } type UpdateCrlOutput struct { // The state of the certificate revocation list (CRL) after a read or write // operation. // // This member is required. Crl *types.CrlDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateCrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCrl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateCrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCrl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateCrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "UpdateCrl", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a profile, a list of the roles that IAM Roles Anywhere service is // trusted to assume. You use profiles to intersect permissions with IAM managed // policies. Required permissions: rolesanywhere:UpdateProfile . func (c *Client) UpdateProfile(ctx context.Context, params *UpdateProfileInput, optFns ...func(*Options)) (*UpdateProfileOutput, error) { if params == nil { params = &UpdateProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateProfile", params, optFns, c.addOperationUpdateProfileMiddlewares) if err != nil { return nil, err } out := result.(*UpdateProfileOutput) out.ResultMetadata = metadata return out, nil } type UpdateProfileInput struct { // The unique identifier of the profile. // // This member is required. ProfileId *string // The number of seconds the vended session credentials are valid for. DurationSeconds *int32 // A list of managed policy ARNs that apply to the vended session credentials. ManagedPolicyArns []string // The name of the profile. Name *string // A list of IAM roles that this profile can assume in a temporary credential // request. RoleArns []string // A session policy that applies to the trust boundary of the vended session // credentials. SessionPolicy *string noSmithyDocumentSerde } type UpdateProfileOutput struct { // The state of the profile after a read or write operation. Profile *types.ProfileDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "UpdateProfile", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a trust anchor. You establish trust between IAM Roles Anywhere and your // certificate authority (CA) by configuring a trust anchor. You can define a trust // anchor as a reference to an Private Certificate Authority (Private CA) or by // uploading a CA certificate. Your Amazon Web Services workloads can authenticate // with the trust anchor using certificates issued by the CA in exchange for // temporary Amazon Web Services credentials. Required permissions: // rolesanywhere:UpdateTrustAnchor . func (c *Client) UpdateTrustAnchor(ctx context.Context, params *UpdateTrustAnchorInput, optFns ...func(*Options)) (*UpdateTrustAnchorOutput, error) { if params == nil { params = &UpdateTrustAnchorInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateTrustAnchor", params, optFns, c.addOperationUpdateTrustAnchorMiddlewares) if err != nil { return nil, err } out := result.(*UpdateTrustAnchorOutput) out.ResultMetadata = metadata return out, nil } type UpdateTrustAnchorInput struct { // The unique identifier of the trust anchor. // // This member is required. TrustAnchorId *string // The name of the trust anchor. Name *string // The trust anchor type and its related certificate data. Source *types.Source noSmithyDocumentSerde } type UpdateTrustAnchorOutput struct { // The state of the trust anchor after a read or write operation. // // This member is required. TrustAnchor *types.TrustAnchorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateTrustAnchorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTrustAnchor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTrustAnchor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateTrustAnchorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTrustAnchor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateTrustAnchor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rolesanywhere", OperationName: "UpdateTrustAnchor", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCreateProfile struct { } func (*awsRestjson1_deserializeOpCreateProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateProfile(response, &metadata) } output := &CreateProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateProfileOutput(&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_deserializeOpErrorCreateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateProfileOutput(v **CreateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateProfileOutput if *v == nil { sv = &CreateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTrustAnchor struct { } func (*awsRestjson1_deserializeOpCreateTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateTrustAnchor(response, &metadata) } output := &CreateTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentCreateTrustAnchorOutput(&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_deserializeOpErrorCreateTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateTrustAnchorOutput(v **CreateTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateTrustAnchorOutput if *v == nil { sv = &CreateTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteCrl struct { } func (*awsRestjson1_deserializeOpDeleteCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteCrl(response, &metadata) } output := &DeleteCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDeleteCrlOutput(&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_deserializeOpErrorDeleteCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteCrlOutput(v **DeleteCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteCrlOutput if *v == nil { sv = &DeleteCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteProfile struct { } func (*awsRestjson1_deserializeOpDeleteProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteProfile(response, &metadata) } output := &DeleteProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDeleteProfileOutput(&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_deserializeOpErrorDeleteProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteProfileOutput(v **DeleteProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteProfileOutput if *v == nil { sv = &DeleteProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTrustAnchor struct { } func (*awsRestjson1_deserializeOpDeleteTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteTrustAnchor(response, &metadata) } output := &DeleteTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDeleteTrustAnchorOutput(&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_deserializeOpErrorDeleteTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteTrustAnchorOutput(v **DeleteTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTrustAnchorOutput if *v == nil { sv = &DeleteTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisableCrl struct { } func (*awsRestjson1_deserializeOpDisableCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDisableCrl(response, &metadata) } output := &DisableCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDisableCrlOutput(&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_deserializeOpErrorDisableCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDisableCrlOutput(v **DisableCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableCrlOutput if *v == nil { sv = &DisableCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisableProfile struct { } func (*awsRestjson1_deserializeOpDisableProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDisableProfile(response, &metadata) } output := &DisableProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDisableProfileOutput(&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_deserializeOpErrorDisableProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDisableProfileOutput(v **DisableProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableProfileOutput if *v == nil { sv = &DisableProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisableTrustAnchor struct { } func (*awsRestjson1_deserializeOpDisableTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDisableTrustAnchor(response, &metadata) } output := &DisableTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentDisableTrustAnchorOutput(&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_deserializeOpErrorDisableTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDisableTrustAnchorOutput(v **DisableTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableTrustAnchorOutput if *v == nil { sv = &DisableTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpEnableCrl struct { } func (*awsRestjson1_deserializeOpEnableCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorEnableCrl(response, &metadata) } output := &EnableCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentEnableCrlOutput(&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_deserializeOpErrorEnableCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentEnableCrlOutput(v **EnableCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableCrlOutput if *v == nil { sv = &EnableCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpEnableProfile struct { } func (*awsRestjson1_deserializeOpEnableProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorEnableProfile(response, &metadata) } output := &EnableProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentEnableProfileOutput(&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_deserializeOpErrorEnableProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentEnableProfileOutput(v **EnableProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableProfileOutput if *v == nil { sv = &EnableProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpEnableTrustAnchor struct { } func (*awsRestjson1_deserializeOpEnableTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorEnableTrustAnchor(response, &metadata) } output := &EnableTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentEnableTrustAnchorOutput(&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_deserializeOpErrorEnableTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentEnableTrustAnchorOutput(v **EnableTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableTrustAnchorOutput if *v == nil { sv = &EnableTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetCrl struct { } func (*awsRestjson1_deserializeOpGetCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetCrl(response, &metadata) } output := &GetCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentGetCrlOutput(&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_deserializeOpErrorGetCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCrlOutput(v **GetCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetCrlOutput if *v == nil { sv = &GetCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetProfile struct { } func (*awsRestjson1_deserializeOpGetProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetProfile(response, &metadata) } output := &GetProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentGetProfileOutput(&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_deserializeOpErrorGetProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetProfileOutput(v **GetProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetProfileOutput if *v == nil { sv = &GetProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetSubject struct { } func (*awsRestjson1_deserializeOpGetSubject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetSubject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetSubject(response, &metadata) } output := &GetSubjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentGetSubjectOutput(&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_deserializeOpErrorGetSubject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetSubjectOutput(v **GetSubjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetSubjectOutput if *v == nil { sv = &GetSubjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "subject": if err := awsRestjson1_deserializeDocumentSubjectDetail(&sv.Subject, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetTrustAnchor struct { } func (*awsRestjson1_deserializeOpGetTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetTrustAnchor(response, &metadata) } output := &GetTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentGetTrustAnchorOutput(&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_deserializeOpErrorGetTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetTrustAnchorOutput(v **GetTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetTrustAnchorOutput if *v == nil { sv = &GetTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpImportCrl struct { } func (*awsRestjson1_deserializeOpImportCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpImportCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorImportCrl(response, &metadata) } output := &ImportCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentImportCrlOutput(&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_deserializeOpErrorImportCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentImportCrlOutput(v **ImportCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportCrlOutput if *v == nil { sv = &ImportCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListCrls struct { } func (*awsRestjson1_deserializeOpListCrls) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListCrls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListCrls(response, &metadata) } output := &ListCrlsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListCrlsOutput(&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_deserializeOpErrorListCrls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListCrlsOutput(v **ListCrlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListCrlsOutput if *v == nil { sv = &ListCrlsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crls": if err := awsRestjson1_deserializeDocumentCrlDetails(&sv.Crls, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListProfiles struct { } func (*awsRestjson1_deserializeOpListProfiles) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListProfiles(response, &metadata) } output := &ListProfilesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListProfilesOutput(&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_deserializeOpErrorListProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListProfilesOutput(v **ListProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListProfilesOutput if *v == nil { sv = &ListProfilesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "profiles": if err := awsRestjson1_deserializeDocumentProfileDetails(&sv.Profiles, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSubjects struct { } func (*awsRestjson1_deserializeOpListSubjects) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSubjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListSubjects(response, &metadata) } output := &ListSubjectsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListSubjectsOutput(&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_deserializeOpErrorListSubjects(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSubjectsOutput(v **ListSubjectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSubjectsOutput if *v == nil { sv = &ListSubjectsOutput{} } 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 "subjects": if err := awsRestjson1_deserializeDocumentSubjectSummaries(&sv.Subjects, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTrustAnchors struct { } func (*awsRestjson1_deserializeOpListTrustAnchors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTrustAnchors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListTrustAnchors(response, &metadata) } output := &ListTrustAnchorsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentListTrustAnchorsOutput(&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_deserializeOpErrorListTrustAnchors(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTrustAnchorsOutput(v **ListTrustAnchorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTrustAnchorsOutput if *v == nil { sv = &ListTrustAnchorsOutput{} } 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 "trustAnchors": if err := awsRestjson1_deserializeDocumentTrustAnchorDetails(&sv.TrustAnchors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutNotificationSettings struct { } func (*awsRestjson1_deserializeOpPutNotificationSettings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutNotificationSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorPutNotificationSettings(response, &metadata) } output := &PutNotificationSettingsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentPutNotificationSettingsOutput(&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_deserializeOpErrorPutNotificationSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutNotificationSettingsOutput(v **PutNotificationSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutNotificationSettingsOutput if *v == nil { sv = &PutNotificationSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpResetNotificationSettings struct { } func (*awsRestjson1_deserializeOpResetNotificationSettings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpResetNotificationSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorResetNotificationSettings(response, &metadata) } output := &ResetNotificationSettingsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentResetNotificationSettingsOutput(&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_deserializeOpErrorResetNotificationSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentResetNotificationSettingsOutput(v **ResetNotificationSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ResetNotificationSettingsOutput if *v == nil { sv = &ResetNotificationSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateCrl struct { } func (*awsRestjson1_deserializeOpUpdateCrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateCrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateCrl(response, &metadata) } output := &UpdateCrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentUpdateCrlOutput(&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_deserializeOpErrorUpdateCrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateCrlOutput(v **UpdateCrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateCrlOutput if *v == nil { sv = &UpdateCrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "crl": if err := awsRestjson1_deserializeDocumentCrlDetail(&sv.Crl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateProfile struct { } func (*awsRestjson1_deserializeOpUpdateProfile) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateProfile(response, &metadata) } output := &UpdateProfileOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateProfileOutput(&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_deserializeOpErrorUpdateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateProfileOutput(v **UpdateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateProfileOutput if *v == nil { sv = &UpdateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { case "profile": if err := awsRestjson1_deserializeDocumentProfileDetail(&sv.Profile, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTrustAnchor struct { } func (*awsRestjson1_deserializeOpUpdateTrustAnchor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTrustAnchor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateTrustAnchor(response, &metadata) } output := &UpdateTrustAnchorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.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_deserializeOpDocumentUpdateTrustAnchorOutput(&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_deserializeOpErrorUpdateTrustAnchor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateTrustAnchorOutput(v **UpdateTrustAnchorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTrustAnchorOutput if *v == nil { sv = &UpdateTrustAnchorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "trustAnchor": if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyTagsException{} 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_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCredentialSummaries(v *[]types.CredentialSummary, 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.CredentialSummary if *v == nil { cv = []types.CredentialSummary{} } else { cv = *v } for _, value := range shape { var col types.CredentialSummary destAddr := &col if err := awsRestjson1_deserializeDocumentCredentialSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCredentialSummary(v **types.CredentialSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CredentialSummary if *v == nil { sv = &types.CredentialSummary{} } 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 Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "failed": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Failed = ptr.Bool(jtv) } case "issuer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Issuer = ptr.String(jtv) } case "seenAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.SeenAt = ptr.Time(t) } case "serialNumber": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SerialNumber = ptr.String(jtv) } case "x509CertificateData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.X509CertificateData = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCrlDetail(v **types.CrlDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CrlDetail if *v == nil { sv = &types.CrlDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "crlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CrlArn = ptr.String(jtv) } case "crlData": 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.CrlData = dv } case "crlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } sv.CrlId = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(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) } case "trustAnchorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TrustAnchorArn = ptr.String(jtv) } case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCrlDetails(v *[]types.CrlDetail, 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.CrlDetail if *v == nil { cv = []types.CrlDetail{} } else { cv = *v } for _, value := range shape { var col types.CrlDetail destAddr := &col if err := awsRestjson1_deserializeDocumentCrlDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInstanceProperties(v *[]types.InstanceProperty, 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.InstanceProperty if *v == nil { cv = []types.InstanceProperty{} } else { cv = *v } for _, value := range shape { var col types.InstanceProperty destAddr := &col if err := awsRestjson1_deserializeDocumentInstanceProperty(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInstanceProperty(v **types.InstanceProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InstanceProperty if *v == nil { sv = &types.InstanceProperty{} } else { sv = *v } for key, value := range shape { switch key { case "failed": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Failed = ptr.Bool(jtv) } case "properties": if err := awsRestjson1_deserializeDocumentInstancePropertyMap(&sv.Properties, value); err != nil { return err } case "seenAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.SeenAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstancePropertyMap(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_deserializeDocumentManagedPolicyList(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_deserializeDocumentNotificationSettingDetail(v **types.NotificationSettingDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NotificationSettingDetail if *v == nil { sv = &types.NotificationSettingDetail{} } else { sv = *v } for key, value := range shape { switch key { case "channel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NotificationChannel to be of type string, got %T instead", value) } sv.Channel = types.NotificationChannel(jtv) } case "configuredBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ConfiguredBy = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "event": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NotificationEvent to be of type string, got %T instead", value) } sv.Event = types.NotificationEvent(jtv) } case "threshold": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Threshold = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotificationSettingDetails(v *[]types.NotificationSettingDetail, 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.NotificationSettingDetail if *v == nil { cv = []types.NotificationSettingDetail{} } else { cv = *v } for _, value := range shape { var col types.NotificationSettingDetail destAddr := &col if err := awsRestjson1_deserializeDocumentNotificationSettingDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProfileDetail(v **types.ProfileDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProfileDetail if *v == nil { sv = &types.ProfileDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "createdBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CreatedBy = ptr.String(jtv) } case "durationSeconds": 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.DurationSeconds = ptr.Int32(int32(i64)) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "managedPolicyArns": if err := awsRestjson1_deserializeDocumentManagedPolicyList(&sv.ManagedPolicyArns, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "profileArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProfileArn to be of type string, got %T instead", value) } sv.ProfileArn = ptr.String(jtv) } case "profileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } sv.ProfileId = ptr.String(jtv) } case "requireInstanceProperties": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RequireInstanceProperties = ptr.Bool(jtv) } case "roleArns": if err := awsRestjson1_deserializeDocumentRoleArnList(&sv.RoleArns, value); err != nil { return err } case "sessionPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SessionPolicy = ptr.String(jtv) } case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProfileDetails(v *[]types.ProfileDetail, 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.ProfileDetail if *v == nil { cv = []types.ProfileDetail{} } else { cv = *v } for _, value := range shape { var col types.ProfileDetail destAddr := &col if err := awsRestjson1_deserializeDocumentProfileDetail(&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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRoleArnList(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 RoleArn to be of type string, got %T instead", value) } col = jtv } 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 "sourceData": if err := awsRestjson1_deserializeDocumentSourceData(&sv.SourceData, value); err != nil { return err } case "sourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TrustAnchorType to be of type string, got %T instead", value) } sv.SourceType = types.TrustAnchorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceData(v *types.SourceData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var uv types.SourceData loop: for key, value := range shape { if value == nil { continue } switch key { case "acmPcaArn": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } mv = jtv } uv = &types.SourceDataMemberAcmPcaArn{Value: mv} break loop case "x509CertificateData": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } mv = jtv } uv = &types.SourceDataMemberX509CertificateData{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentSubjectDetail(v **types.SubjectDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SubjectDetail if *v == nil { sv = &types.SubjectDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "credentials": if err := awsRestjson1_deserializeDocumentCredentialSummaries(&sv.Credentials, value); err != nil { return err } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "instanceProperties": if err := awsRestjson1_deserializeDocumentInstanceProperties(&sv.InstanceProperties, value); err != nil { return err } case "lastSeenAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.LastSeenAt = ptr.Time(t) } case "subjectArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SubjectArn = ptr.String(jtv) } case "subjectId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } sv.SubjectId = ptr.String(jtv) } case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } case "x509Subject": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.X509Subject = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSubjectSummaries(v *[]types.SubjectSummary, 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.SubjectSummary if *v == nil { cv = []types.SubjectSummary{} } else { cv = *v } for _, value := range shape { var col types.SubjectSummary destAddr := &col if err := awsRestjson1_deserializeDocumentSubjectSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubjectSummary(v **types.SubjectSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SubjectSummary if *v == nil { sv = &types.SubjectSummary{} } else { sv = *v } for key, value := range shape { switch key { case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "lastSeenAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.LastSeenAt = ptr.Time(t) } case "subjectArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SubjectArn = ptr.String(jtv) } case "subjectId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } sv.SubjectId = ptr.String(jtv) } case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } case "x509Subject": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.X509Subject = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyTagsException if *v == nil { sv = &types.TooManyTagsException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTrustAnchorDetail(v **types.TrustAnchorDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TrustAnchorDetail if *v == nil { sv = &types.TrustAnchorDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "notificationSettings": if err := awsRestjson1_deserializeDocumentNotificationSettingDetails(&sv.NotificationSettings, value); err != nil { return err } case "source": if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { return err } case "trustAnchorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TrustAnchorArn = ptr.String(jtv) } case "trustAnchorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } sv.TrustAnchorId = ptr.String(jtv) } case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTrustAnchorDetails(v *[]types.TrustAnchorDetail, 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.TrustAnchorDetail if *v == nil { cv = []types.TrustAnchorDetail{} } else { cv = *v } for _, value := range shape { var col types.TrustAnchorDetail destAddr := &col if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
5,799
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package rolesanywhere provides the API client, operations, and parameter types // for IAM Roles Anywhere. // // Identity and Access Management Roles Anywhere provides a secure way for your // workloads such as servers, containers, and applications that run outside of // Amazon Web Services to obtain temporary Amazon Web Services credentials. Your // workloads can use the same IAM policies and roles you have for native Amazon Web // Services applications to access Amazon Web Services resources. Using IAM Roles // Anywhere eliminates the need to manage long-term credentials for workloads // running outside of Amazon Web Services. To use IAM Roles Anywhere, your // workloads must use X.509 certificates issued by their certificate authority // (CA). You register the CA with IAM Roles Anywhere as a trust anchor to establish // trust between your public key infrastructure (PKI) and IAM Roles Anywhere. If // you don't manage your own PKI system, you can use Private Certificate Authority // to create a CA and then use that to establish trust with IAM Roles Anywhere. // This guide describes the IAM Roles Anywhere operations that you can call // programmatically. For more information about IAM Roles Anywhere, see the IAM // Roles Anywhere User Guide (https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html) // . package rolesanywhere
23
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere 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/rolesanywhere/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 = "rolesanywhere" } 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 rolesanywhere // goModuleVersion is the tagged release for this module const goModuleVersion = "1.2.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpCreateProfile struct { } func (*awsRestjson1_serializeOpCreateProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profiles") 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_serializeOpDocumentCreateProfileInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateProfileInput(v *CreateProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateProfileInput(v *CreateProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DurationSeconds != nil { ok := object.Key("durationSeconds") ok.Integer(*v.DurationSeconds) } if v.Enabled != nil { ok := object.Key("enabled") ok.Boolean(*v.Enabled) } if v.ManagedPolicyArns != nil { ok := object.Key("managedPolicyArns") if err := awsRestjson1_serializeDocumentManagedPolicyList(v.ManagedPolicyArns, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RequireInstanceProperties != nil { ok := object.Key("requireInstanceProperties") ok.Boolean(*v.RequireInstanceProperties) } if v.RoleArns != nil { ok := object.Key("roleArns") if err := awsRestjson1_serializeDocumentRoleArnList(v.RoleArns, ok); err != nil { return err } } if v.SessionPolicy != nil { ok := object.Key("sessionPolicy") ok.String(*v.SessionPolicy) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateTrustAnchor struct { } func (*awsRestjson1_serializeOpCreateTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchors") 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_serializeOpDocumentCreateTrustAnchorInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateTrustAnchorInput(v *CreateTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateTrustAnchorInput(v *CreateTrustAnchorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("enabled") ok.Boolean(*v.Enabled) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.NotificationSettings != nil { ok := object.Key("notificationSettings") if err := awsRestjson1_serializeDocumentNotificationSettings(v.NotificationSettings, ok); err != nil { return err } } if v.Source != nil { ok := object.Key("source") if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteCrl struct { } func (*awsRestjson1_serializeOpDeleteCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crl/{crlId}") 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_serializeOpHttpBindingsDeleteCrlInput(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_serializeOpHttpBindingsDeleteCrlInput(v *DeleteCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CrlId == nil || len(*v.CrlId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member crlId must not be empty")} } if v.CrlId != nil { if err := encoder.SetURI("crlId").String(*v.CrlId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteProfile struct { } func (*awsRestjson1_serializeOpDeleteProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profile/{profileId}") 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_serializeOpHttpBindingsDeleteProfileInput(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_serializeOpHttpBindingsDeleteProfileInput(v *DeleteProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProfileId == nil || len(*v.ProfileId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member profileId must not be empty")} } if v.ProfileId != nil { if err := encoder.SetURI("profileId").String(*v.ProfileId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteTrustAnchor struct { } func (*awsRestjson1_serializeOpDeleteTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchor/{trustAnchorId}") 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_serializeOpHttpBindingsDeleteTrustAnchorInput(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_serializeOpHttpBindingsDeleteTrustAnchorInput(v *DeleteTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TrustAnchorId == nil || len(*v.TrustAnchorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member trustAnchorId must not be empty")} } if v.TrustAnchorId != nil { if err := encoder.SetURI("trustAnchorId").String(*v.TrustAnchorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDisableCrl struct { } func (*awsRestjson1_serializeOpDisableCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crl/{crlId}/disable") 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_serializeOpHttpBindingsDisableCrlInput(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_serializeOpHttpBindingsDisableCrlInput(v *DisableCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CrlId == nil || len(*v.CrlId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member crlId must not be empty")} } if v.CrlId != nil { if err := encoder.SetURI("crlId").String(*v.CrlId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDisableProfile struct { } func (*awsRestjson1_serializeOpDisableProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profile/{profileId}/disable") 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_serializeOpHttpBindingsDisableProfileInput(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_serializeOpHttpBindingsDisableProfileInput(v *DisableProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProfileId == nil || len(*v.ProfileId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member profileId must not be empty")} } if v.ProfileId != nil { if err := encoder.SetURI("profileId").String(*v.ProfileId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDisableTrustAnchor struct { } func (*awsRestjson1_serializeOpDisableTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchor/{trustAnchorId}/disable") 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_serializeOpHttpBindingsDisableTrustAnchorInput(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_serializeOpHttpBindingsDisableTrustAnchorInput(v *DisableTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TrustAnchorId == nil || len(*v.TrustAnchorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member trustAnchorId must not be empty")} } if v.TrustAnchorId != nil { if err := encoder.SetURI("trustAnchorId").String(*v.TrustAnchorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpEnableCrl struct { } func (*awsRestjson1_serializeOpEnableCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crl/{crlId}/enable") 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_serializeOpHttpBindingsEnableCrlInput(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_serializeOpHttpBindingsEnableCrlInput(v *EnableCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CrlId == nil || len(*v.CrlId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member crlId must not be empty")} } if v.CrlId != nil { if err := encoder.SetURI("crlId").String(*v.CrlId); err != nil { return err } } return nil } type awsRestjson1_serializeOpEnableProfile struct { } func (*awsRestjson1_serializeOpEnableProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profile/{profileId}/enable") 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_serializeOpHttpBindingsEnableProfileInput(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_serializeOpHttpBindingsEnableProfileInput(v *EnableProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProfileId == nil || len(*v.ProfileId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member profileId must not be empty")} } if v.ProfileId != nil { if err := encoder.SetURI("profileId").String(*v.ProfileId); err != nil { return err } } return nil } type awsRestjson1_serializeOpEnableTrustAnchor struct { } func (*awsRestjson1_serializeOpEnableTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchor/{trustAnchorId}/enable") 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_serializeOpHttpBindingsEnableTrustAnchorInput(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_serializeOpHttpBindingsEnableTrustAnchorInput(v *EnableTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TrustAnchorId == nil || len(*v.TrustAnchorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member trustAnchorId must not be empty")} } if v.TrustAnchorId != nil { if err := encoder.SetURI("trustAnchorId").String(*v.TrustAnchorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetCrl struct { } func (*awsRestjson1_serializeOpGetCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crl/{crlId}") 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_serializeOpHttpBindingsGetCrlInput(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_serializeOpHttpBindingsGetCrlInput(v *GetCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CrlId == nil || len(*v.CrlId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member crlId must not be empty")} } if v.CrlId != nil { if err := encoder.SetURI("crlId").String(*v.CrlId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetProfile struct { } func (*awsRestjson1_serializeOpGetProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profile/{profileId}") 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_serializeOpHttpBindingsGetProfileInput(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_serializeOpHttpBindingsGetProfileInput(v *GetProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProfileId == nil || len(*v.ProfileId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member profileId must not be empty")} } if v.ProfileId != nil { if err := encoder.SetURI("profileId").String(*v.ProfileId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetSubject struct { } func (*awsRestjson1_serializeOpGetSubject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetSubject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetSubjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/subject/{subjectId}") 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_serializeOpHttpBindingsGetSubjectInput(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_serializeOpHttpBindingsGetSubjectInput(v *GetSubjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.SubjectId == nil || len(*v.SubjectId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member subjectId must not be empty")} } if v.SubjectId != nil { if err := encoder.SetURI("subjectId").String(*v.SubjectId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetTrustAnchor struct { } func (*awsRestjson1_serializeOpGetTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchor/{trustAnchorId}") 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_serializeOpHttpBindingsGetTrustAnchorInput(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_serializeOpHttpBindingsGetTrustAnchorInput(v *GetTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TrustAnchorId == nil || len(*v.TrustAnchorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member trustAnchorId must not be empty")} } if v.TrustAnchorId != nil { if err := encoder.SetURI("trustAnchorId").String(*v.TrustAnchorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpImportCrl struct { } func (*awsRestjson1_serializeOpImportCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpImportCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crls") 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_serializeOpDocumentImportCrlInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsImportCrlInput(v *ImportCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentImportCrlInput(v *ImportCrlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CrlData != nil { ok := object.Key("crlData") ok.Base64EncodeBytes(v.CrlData) } if v.Enabled != nil { ok := object.Key("enabled") ok.Boolean(*v.Enabled) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } if v.TrustAnchorArn != nil { ok := object.Key("trustAnchorArn") ok.String(*v.TrustAnchorArn) } return nil } type awsRestjson1_serializeOpListCrls struct { } func (*awsRestjson1_serializeOpListCrls) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListCrls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListCrlsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crls") 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_serializeOpHttpBindingsListCrlsInput(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_serializeOpHttpBindingsListCrlsInput(v *ListCrlsInput, 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.PageSize != nil { encoder.SetQuery("pageSize").Integer(*v.PageSize) } return nil } type awsRestjson1_serializeOpListProfiles struct { } func (*awsRestjson1_serializeOpListProfiles) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProfilesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/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_serializeOpHttpBindingsListProfilesInput(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_serializeOpHttpBindingsListProfilesInput(v *ListProfilesInput, 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.PageSize != nil { encoder.SetQuery("pageSize").Integer(*v.PageSize) } return nil } type awsRestjson1_serializeOpListSubjects struct { } func (*awsRestjson1_serializeOpListSubjects) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSubjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSubjectsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/subjects") 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_serializeOpHttpBindingsListSubjectsInput(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_serializeOpHttpBindingsListSubjectsInput(v *ListSubjectsInput, 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.PageSize != nil { encoder.SetQuery("pageSize").Integer(*v.PageSize) } 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("/ListTagsForResource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpListTrustAnchors struct { } func (*awsRestjson1_serializeOpListTrustAnchors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTrustAnchors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTrustAnchorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchors") 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_serializeOpHttpBindingsListTrustAnchorsInput(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_serializeOpHttpBindingsListTrustAnchorsInput(v *ListTrustAnchorsInput, 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.PageSize != nil { encoder.SetQuery("pageSize").Integer(*v.PageSize) } return nil } type awsRestjson1_serializeOpPutNotificationSettings struct { } func (*awsRestjson1_serializeOpPutNotificationSettings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutNotificationSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutNotificationSettingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/put-notifications-settings") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutNotificationSettingsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutNotificationSettingsInput(v *PutNotificationSettingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutNotificationSettingsInput(v *PutNotificationSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NotificationSettings != nil { ok := object.Key("notificationSettings") if err := awsRestjson1_serializeDocumentNotificationSettings(v.NotificationSettings, ok); err != nil { return err } } if v.TrustAnchorId != nil { ok := object.Key("trustAnchorId") ok.String(*v.TrustAnchorId) } return nil } type awsRestjson1_serializeOpResetNotificationSettings struct { } func (*awsRestjson1_serializeOpResetNotificationSettings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpResetNotificationSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ResetNotificationSettingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/reset-notifications-settings") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentResetNotificationSettingsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsResetNotificationSettingsInput(v *ResetNotificationSettingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentResetNotificationSettingsInput(v *ResetNotificationSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NotificationSettingKeys != nil { ok := object.Key("notificationSettingKeys") if err := awsRestjson1_serializeDocumentNotificationSettingKeys(v.NotificationSettingKeys, ok); err != nil { return err } } if v.TrustAnchorId != nil { ok := object.Key("trustAnchorId") ok.String(*v.TrustAnchorId) } 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("/TagResource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } 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) } return nil } func awsRestjson1_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 := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UntagResource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_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 := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateCrl struct { } func (*awsRestjson1_serializeOpUpdateCrl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateCrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateCrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/crl/{crlId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateCrlInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateCrlInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateCrlInput(v *UpdateCrlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CrlId == nil || len(*v.CrlId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member crlId must not be empty")} } if v.CrlId != nil { if err := encoder.SetURI("crlId").String(*v.CrlId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateCrlInput(v *UpdateCrlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CrlData != nil { ok := object.Key("crlData") ok.Base64EncodeBytes(v.CrlData) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } return nil } type awsRestjson1_serializeOpUpdateProfile struct { } func (*awsRestjson1_serializeOpUpdateProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/profile/{profileId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateProfileInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateProfileInput(v *UpdateProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProfileId == nil || len(*v.ProfileId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member profileId must not be empty")} } if v.ProfileId != nil { if err := encoder.SetURI("profileId").String(*v.ProfileId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateProfileInput(v *UpdateProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DurationSeconds != nil { ok := object.Key("durationSeconds") ok.Integer(*v.DurationSeconds) } if v.ManagedPolicyArns != nil { ok := object.Key("managedPolicyArns") if err := awsRestjson1_serializeDocumentManagedPolicyList(v.ManagedPolicyArns, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RoleArns != nil { ok := object.Key("roleArns") if err := awsRestjson1_serializeDocumentRoleArnList(v.RoleArns, ok); err != nil { return err } } if v.SessionPolicy != nil { ok := object.Key("sessionPolicy") ok.String(*v.SessionPolicy) } return nil } type awsRestjson1_serializeOpUpdateTrustAnchor struct { } func (*awsRestjson1_serializeOpUpdateTrustAnchor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateTrustAnchor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateTrustAnchorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/trustanchor/{trustAnchorId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateTrustAnchorInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateTrustAnchorInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateTrustAnchorInput(v *UpdateTrustAnchorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TrustAnchorId == nil || len(*v.TrustAnchorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member trustAnchorId must not be empty")} } if v.TrustAnchorId != nil { if err := encoder.SetURI("trustAnchorId").String(*v.TrustAnchorId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateTrustAnchorInput(v *UpdateTrustAnchorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Source != nil { ok := object.Key("source") if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentManagedPolicyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentNotificationSetting(v *types.NotificationSetting, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Channel) > 0 { ok := object.Key("channel") ok.String(string(v.Channel)) } if v.Enabled != nil { ok := object.Key("enabled") ok.Boolean(*v.Enabled) } if len(v.Event) > 0 { ok := object.Key("event") ok.String(string(v.Event)) } if v.Threshold != nil { ok := object.Key("threshold") ok.Integer(*v.Threshold) } return nil } func awsRestjson1_serializeDocumentNotificationSettingKey(v *types.NotificationSettingKey, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Channel) > 0 { ok := object.Key("channel") ok.String(string(v.Channel)) } if len(v.Event) > 0 { ok := object.Key("event") ok.String(string(v.Event)) } return nil } func awsRestjson1_serializeDocumentNotificationSettingKeys(v []types.NotificationSettingKey, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentNotificationSettingKey(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNotificationSettings(v []types.NotificationSetting, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentNotificationSetting(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentRoleArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentSource(v *types.Source, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceData != nil { ok := object.Key("sourceData") if err := awsRestjson1_serializeDocumentSourceData(v.SourceData, ok); err != nil { return err } } if len(v.SourceType) > 0 { ok := object.Key("sourceType") ok.String(string(v.SourceType)) } return nil } func awsRestjson1_serializeDocumentSourceData(v types.SourceData, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.SourceDataMemberAcmPcaArn: av := object.Key("acmPcaArn") av.String(uv.Value) case *types.SourceDataMemberX509CertificateData: av := object.Key("x509CertificateData") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_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 awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil }
2,095
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package rolesanywhere import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateProfile struct { } func (*validateOpCreateProfile) ID() string { return "OperationInputValidation" } func (m *validateOpCreateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateTrustAnchor struct { } func (*validateOpCreateTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpCreateTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCrl struct { } func (*validateOpDeleteCrl) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteProfile struct { } func (*validateOpDeleteProfile) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTrustAnchor struct { } func (*validateOpDeleteTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableCrl struct { } func (*validateOpDisableCrl) ID() string { return "OperationInputValidation" } func (m *validateOpDisableCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableCrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableProfile struct { } func (*validateOpDisableProfile) ID() string { return "OperationInputValidation" } func (m *validateOpDisableProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableTrustAnchor struct { } func (*validateOpDisableTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpDisableTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableCrl struct { } func (*validateOpEnableCrl) ID() string { return "OperationInputValidation" } func (m *validateOpEnableCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableCrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableProfile struct { } func (*validateOpEnableProfile) ID() string { return "OperationInputValidation" } func (m *validateOpEnableProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableTrustAnchor struct { } func (*validateOpEnableTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpEnableTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetCrl struct { } func (*validateOpGetCrl) ID() string { return "OperationInputValidation" } func (m *validateOpGetCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetCrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetProfile struct { } func (*validateOpGetProfile) ID() string { return "OperationInputValidation" } func (m *validateOpGetProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSubject struct { } func (*validateOpGetSubject) ID() string { return "OperationInputValidation" } func (m *validateOpGetSubject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSubjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSubjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetTrustAnchor struct { } func (*validateOpGetTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpGetTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportCrl struct { } func (*validateOpImportCrl) ID() string { return "OperationInputValidation" } func (m *validateOpImportCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportCrlInput(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 validateOpPutNotificationSettings struct { } func (*validateOpPutNotificationSettings) ID() string { return "OperationInputValidation" } func (m *validateOpPutNotificationSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutNotificationSettingsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutNotificationSettingsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpResetNotificationSettings struct { } func (*validateOpResetNotificationSettings) ID() string { return "OperationInputValidation" } func (m *validateOpResetNotificationSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ResetNotificationSettingsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpResetNotificationSettingsInput(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 validateOpUpdateCrl struct { } func (*validateOpUpdateCrl) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateCrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateCrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateCrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateProfile struct { } func (*validateOpUpdateProfile) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateTrustAnchor struct { } func (*validateOpUpdateTrustAnchor) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateTrustAnchor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateTrustAnchorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateTrustAnchorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProfile{}, middleware.After) } func addOpCreateTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTrustAnchor{}, middleware.After) } func addOpDeleteCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCrl{}, middleware.After) } func addOpDeleteProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProfile{}, middleware.After) } func addOpDeleteTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTrustAnchor{}, middleware.After) } func addOpDisableCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableCrl{}, middleware.After) } func addOpDisableProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableProfile{}, middleware.After) } func addOpDisableTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableTrustAnchor{}, middleware.After) } func addOpEnableCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableCrl{}, middleware.After) } func addOpEnableProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableProfile{}, middleware.After) } func addOpEnableTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableTrustAnchor{}, middleware.After) } func addOpGetCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCrl{}, middleware.After) } func addOpGetProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetProfile{}, middleware.After) } func addOpGetSubjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSubject{}, middleware.After) } func addOpGetTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTrustAnchor{}, middleware.After) } func addOpImportCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportCrl{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpPutNotificationSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutNotificationSettings{}, middleware.After) } func addOpResetNotificationSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpResetNotificationSettings{}, 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 addOpUpdateCrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCrl{}, middleware.After) } func addOpUpdateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProfile{}, middleware.After) } func addOpUpdateTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTrustAnchor{}, middleware.After) } func validateNotificationSetting(v *types.NotificationSetting) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationSetting"} if v.Enabled == nil { invalidParams.Add(smithy.NewErrParamRequired("Enabled")) } if len(v.Event) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Event")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNotificationSettingKey(v *types.NotificationSettingKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationSettingKey"} if len(v.Event) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Event")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNotificationSettingKeys(v []types.NotificationSettingKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationSettingKeys"} for i := range v { if err := validateNotificationSettingKey(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNotificationSettings(v []types.NotificationSetting) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationSettings"} for i := range v { if err := validateNotificationSetting(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateProfileInput(v *CreateProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateProfileInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.RoleArns == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleArns")) } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateTrustAnchorInput(v *CreateTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateTrustAnchorInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Source == nil { invalidParams.Add(smithy.NewErrParamRequired("Source")) } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if v.NotificationSettings != nil { if err := validateNotificationSettings(v.NotificationSettings); err != nil { invalidParams.AddNested("NotificationSettings", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCrlInput(v *DeleteCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCrlInput"} if v.CrlId == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteProfileInput(v *DeleteProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTrustAnchorInput(v *DeleteTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTrustAnchorInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableCrlInput(v *DisableCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableCrlInput"} if v.CrlId == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableProfileInput(v *DisableProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableTrustAnchorInput(v *DisableTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableTrustAnchorInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableCrlInput(v *EnableCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableCrlInput"} if v.CrlId == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableProfileInput(v *EnableProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableTrustAnchorInput(v *EnableTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableTrustAnchorInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetCrlInput(v *GetCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetCrlInput"} if v.CrlId == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetProfileInput(v *GetProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSubjectInput(v *GetSubjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSubjectInput"} if v.SubjectId == nil { invalidParams.Add(smithy.NewErrParamRequired("SubjectId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetTrustAnchorInput(v *GetTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetTrustAnchorInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpImportCrlInput(v *ImportCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportCrlInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.CrlData == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlData")) } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if v.TrustAnchorArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorArn")) } 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 validateOpPutNotificationSettingsInput(v *PutNotificationSettingsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutNotificationSettingsInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if v.NotificationSettings == nil { invalidParams.Add(smithy.NewErrParamRequired("NotificationSettings")) } else if v.NotificationSettings != nil { if err := validateNotificationSettings(v.NotificationSettings); err != nil { invalidParams.AddNested("NotificationSettings", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpResetNotificationSettingsInput(v *ResetNotificationSettingsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResetNotificationSettingsInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if v.NotificationSettingKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("NotificationSettingKeys")) } else if v.NotificationSettingKeys != nil { if err := validateNotificationSettingKeys(v.NotificationSettingKeys); err != nil { invalidParams.AddNested("NotificationSettingKeys", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.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 validateOpUpdateCrlInput(v *UpdateCrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateCrlInput"} if v.CrlId == nil { invalidParams.Add(smithy.NewErrParamRequired("CrlId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateProfileInput(v *UpdateProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateProfileInput"} if v.ProfileId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateTrustAnchorInput(v *UpdateTrustAnchorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateTrustAnchorInput"} if v.TrustAnchorId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,106
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 RolesAnywhere 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: "rolesanywhere.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "rolesanywhere-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "rolesanywhere-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "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-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "rolesanywhere.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "rolesanywhere-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "rolesanywhere-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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: "rolesanywhere-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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: "rolesanywhere-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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: "rolesanywhere-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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: "rolesanywhere-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{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: "rolesanywhere.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "rolesanywhere-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "rolesanywhere-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "rolesanywhere.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
373
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 NotificationChannel string // Enum values for NotificationChannel const ( NotificationChannelAll NotificationChannel = "ALL" ) // Values returns all known values for NotificationChannel. 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 (NotificationChannel) Values() []NotificationChannel { return []NotificationChannel{ "ALL", } } type NotificationEvent string // Enum values for NotificationEvent const ( NotificationEventCaCertificateExpiry NotificationEvent = "CA_CERTIFICATE_EXPIRY" NotificationEventEndEntityCertificateExpiry NotificationEvent = "END_ENTITY_CERTIFICATE_EXPIRY" ) // Values returns all known values for NotificationEvent. 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 (NotificationEvent) Values() []NotificationEvent { return []NotificationEvent{ "CA_CERTIFICATE_EXPIRY", "END_ENTITY_CERTIFICATE_EXPIRY", } } type TrustAnchorType string // Enum values for TrustAnchorType const ( TrustAnchorTypeAwsAcmPca TrustAnchorType = "AWS_ACM_PCA" TrustAnchorTypeCertificateBundle TrustAnchorType = "CERTIFICATE_BUNDLE" TrustAnchorTypeSelfSignedRepository TrustAnchorType = "SELF_SIGNED_REPOSITORY" ) // Values returns all known values for TrustAnchorType. 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 (TrustAnchorType) Values() []TrustAnchorType { return []TrustAnchorType{ "AWS_ACM_PCA", "CERTIFICATE_BUNDLE", "SELF_SIGNED_REPOSITORY", } }
58
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The resource could not be found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Too many tags. type TooManyTagsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyTagsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyTagsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyTagsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyTagsException" } return *e.ErrorCodeOverride } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Validation exception error. type ValidationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
113
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // A record of a presented X509 credential from a temporary credential request. type CredentialSummary struct { // Indicates whether the credential is enabled. Enabled *bool // Indicates whether the temporary credential request was successful. Failed *bool // The fully qualified domain name of the issuing certificate for the presented // end-entity certificate. Issuer *string // The ISO-8601 time stamp of when the certificate was last used in a temporary // credential request. SeenAt *time.Time // The serial number of the certificate. SerialNumber *string // The PEM-encoded data of the certificate. X509CertificateData *string noSmithyDocumentSerde } // The state of the certificate revocation list (CRL) after a read or write // operation. type CrlDetail struct { // The ISO-8601 timestamp when the certificate revocation list (CRL) was created. CreatedAt *time.Time // The ARN of the certificate revocation list (CRL). CrlArn *string // The state of the certificate revocation list (CRL) after a read or write // operation. CrlData []byte // The unique identifier of the certificate revocation list (CRL). CrlId *string // Indicates whether the certificate revocation list (CRL) is enabled. Enabled *bool // The name of the certificate revocation list (CRL). Name *string // The ARN of the TrustAnchor the certificate revocation list (CRL) will provide // revocation for. TrustAnchorArn *string // The ISO-8601 timestamp when the certificate revocation list (CRL) was last // updated. UpdatedAt *time.Time noSmithyDocumentSerde } // A key-value pair you set that identifies a property of the authenticating // instance. type InstanceProperty struct { // Indicates whether the temporary credential request was successful. Failed *bool // A list of instanceProperty objects. Properties map[string]string // The ISO-8601 time stamp of when the certificate was last used in a temporary // credential request. SeenAt *time.Time noSmithyDocumentSerde } // Customizable notification settings that will be applied to notification events. // IAM Roles Anywhere consumes these settings while notifying across multiple // channels - CloudWatch metrics, EventBridge, and Health Dashboard. type NotificationSetting struct { // Indicates whether the notification setting is enabled. // // This member is required. Enabled *bool // The event to which this notification setting is applied. // // This member is required. Event NotificationEvent // The specified channel of notification. IAM Roles Anywhere uses CloudWatch // metrics, EventBridge, and Health Dashboard to notify for an event. In the // absence of a specific channel, IAM Roles Anywhere applies this setting to 'ALL' // channels. Channel NotificationChannel // The number of days before a notification event. This value is required for a // notification setting that is enabled. Threshold *int32 noSmithyDocumentSerde } // The state of a notification setting. A notification setting includes // information such as event name, threshold, status of the notification setting, // and the channel to notify. type NotificationSettingDetail struct { // Indicates whether the notification setting is enabled. // // This member is required. Enabled *bool // The event to which this notification setting is applied. // // This member is required. Event NotificationEvent // The specified channel of notification. IAM Roles Anywhere uses CloudWatch // metrics, EventBridge, and Health Dashboard to notify for an event. In the // absence of a specific channel, IAM Roles Anywhere applies this setting to 'ALL' // channels. Channel NotificationChannel // The principal that configured the notification setting. For default settings // configured by IAM Roles Anywhere, the value is rolesanywhere.amazonaws.com , and // for customized notifications settings, it is the respective account ID. ConfiguredBy *string // The number of days before a notification event. Threshold *int32 noSmithyDocumentSerde } // A notification setting key to reset. A notification setting key includes the // event and the channel. type NotificationSettingKey struct { // The notification setting event to reset. // // This member is required. Event NotificationEvent // The specified channel of notification. Channel NotificationChannel noSmithyDocumentSerde } // The state of the profile after a read or write operation. type ProfileDetail struct { // The ISO-8601 timestamp when the profile was created. CreatedAt *time.Time // The Amazon Web Services account that created the profile. CreatedBy *string // The number of seconds the vended session credentials are valid for. DurationSeconds *int32 // Indicates whether the profile is enabled. Enabled *bool // A list of managed policy ARNs that apply to the vended session credentials. ManagedPolicyArns []string // The name of the profile. Name *string // The ARN of the profile. ProfileArn *string // The unique identifier of the profile. ProfileId *string // Specifies whether instance properties are required in temporary credential // requests with this profile. RequireInstanceProperties *bool // A list of IAM roles that this profile can assume in a temporary credential // request. RoleArns []string // A session policy that applies to the trust boundary of the vended session // credentials. SessionPolicy *string // The ISO-8601 timestamp when the profile was last updated. UpdatedAt *time.Time noSmithyDocumentSerde } // The trust anchor type and its related certificate data. type Source struct { // The data field of the trust anchor depending on its type. SourceData SourceData // The type of the trust anchor. SourceType TrustAnchorType noSmithyDocumentSerde } // The data field of the trust anchor depending on its type. // // The following types satisfy this interface: // // SourceDataMemberAcmPcaArn // SourceDataMemberX509CertificateData type SourceData interface { isSourceData() } // The root certificate of the Private Certificate Authority specified by this ARN // is used in trust validation for temporary credential requests. Included for // trust anchors of type AWS_ACM_PCA . type SourceDataMemberAcmPcaArn struct { Value string noSmithyDocumentSerde } func (*SourceDataMemberAcmPcaArn) isSourceData() {} // The PEM-encoded data for the certificate anchor. Included for trust anchors of // type CERTIFICATE_BUNDLE . type SourceDataMemberX509CertificateData struct { Value string noSmithyDocumentSerde } func (*SourceDataMemberX509CertificateData) isSourceData() {} // The state of the subject after a read or write operation. type SubjectDetail struct { // The ISO-8601 timestamp when the subject was created. CreatedAt *time.Time // The temporary session credentials vended at the last authenticating call with // this subject. Credentials []CredentialSummary // The enabled status of the subject. Enabled *bool // The specified instance properties associated with the request. InstanceProperties []InstanceProperty // The ISO-8601 timestamp of the last time this subject requested temporary // session credentials. LastSeenAt *time.Time // The ARN of the resource. SubjectArn *string // The id of the resource SubjectId *string // The ISO-8601 timestamp when the subject was last updated. UpdatedAt *time.Time // The x509 principal identifier of the authenticating certificate. X509Subject *string noSmithyDocumentSerde } // A summary representation of subjects. type SubjectSummary struct { // The ISO-8601 time stamp of when the certificate was first used in a temporary // credential request. CreatedAt *time.Time // The enabled status of the subject. Enabled *bool // The ISO-8601 time stamp of when the certificate was last used in a temporary // credential request. LastSeenAt *time.Time // The ARN of the resource. SubjectArn *string // The id of the resource. SubjectId *string // The ISO-8601 timestamp when the subject was last updated. UpdatedAt *time.Time // The x509 principal identifier of the authenticating certificate. X509Subject *string noSmithyDocumentSerde } // A label that consists of a key and value you define. type Tag struct { // The tag key. // // This member is required. Key *string // The tag value. // // This member is required. Value *string noSmithyDocumentSerde } // The state of the trust anchor after a read or write operation. type TrustAnchorDetail struct { // The ISO-8601 timestamp when the trust anchor was created. CreatedAt *time.Time // Indicates whether the trust anchor is enabled. Enabled *bool // The name of the trust anchor. Name *string // A list of notification settings to be associated to the trust anchor. NotificationSettings []NotificationSettingDetail // The trust anchor type and its related certificate data. Source *Source // The ARN of the trust anchor. TrustAnchorArn *string // The unique identifier of the trust anchor. TrustAnchorId *string // The ISO-8601 timestamp when the trust anchor was last updated. UpdatedAt *time.Time noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, // but has an unknown tag. type UnknownUnionMember struct { Tag string Value []byte noSmithyDocumentSerde } func (*UnknownUnionMember) isSourceData() {}
372
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types_test import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere/types" ) func ExampleSourceData_outputUsage() { var union types.SourceData // type switches can be used to check the union value switch v := union.(type) { case *types.SourceDataMemberAcmPcaArn: _ = v.Value // Value is string case *types.SourceDataMemberX509CertificateData: _ = v.Value // Value is string case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *string
30
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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" route53cust "github.com/aws/aws-sdk-go-v2/service/route53/internal/customizations" 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" "strings" "time" ) const ServiceID = "Route 53" const ServiceAPIVersion = "2013-04-01" // Client provides the API client to make operations call for Amazon Route 53. 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, "route53", 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 addSanitizeURLMiddleware(stack *middleware.Stack) error { return route53cust.AddSanitizeURLMiddleware(stack, route53cust.AddSanitizeURLMiddlewareOptions{SanitizeURLInput: sanitizeURLInput}) } // Check for and split apart Route53 resource IDs, setting only the last piece. // This allows the output of one operation e.g. foo/1234 to be used as input in // another operation (e.g. it expects just '1234') func sanitizeURLInput(input interface{}) error { switch i := input.(type) { case *ActivateKeySigningKeyInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *AssociateVPCWithHostedZoneInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *ChangeResourceRecordSetsInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *CreateHostedZoneInput: if i.DelegationSetId != nil { idx := strings.LastIndex(*i.DelegationSetId, `/`) v := (*i.DelegationSetId)[idx+1:] i.DelegationSetId = &v } case *CreateKeySigningKeyInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *CreateQueryLoggingConfigInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *CreateReusableDelegationSetInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *CreateTrafficPolicyInstanceInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *CreateVPCAssociationAuthorizationInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *DeactivateKeySigningKeyInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *DeleteHostedZoneInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } case *DeleteKeySigningKeyInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *DeleteReusableDelegationSetInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } case *DeleteVPCAssociationAuthorizationInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *DisableHostedZoneDNSSECInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *DisassociateVPCFromHostedZoneInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *EnableHostedZoneDNSSECInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *GetChangeInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } case *GetDNSSECInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *GetHostedZoneInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } case *GetHostedZoneLimitInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *GetReusableDelegationSetInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } case *GetReusableDelegationSetLimitInput: if i.DelegationSetId != nil { idx := strings.LastIndex(*i.DelegationSetId, `/`) v := (*i.DelegationSetId)[idx+1:] i.DelegationSetId = &v } case *ListHostedZonesInput: if i.DelegationSetId != nil { idx := strings.LastIndex(*i.DelegationSetId, `/`) v := (*i.DelegationSetId)[idx+1:] i.DelegationSetId = &v } case *ListHostedZonesByNameInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *ListQueryLoggingConfigsInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *ListResourceRecordSetsInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *ListTrafficPolicyInstancesInput: if i.HostedZoneIdMarker != nil { idx := strings.LastIndex(*i.HostedZoneIdMarker, `/`) v := (*i.HostedZoneIdMarker)[idx+1:] i.HostedZoneIdMarker = &v } case *ListTrafficPolicyInstancesByHostedZoneInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *ListTrafficPolicyInstancesByPolicyInput: if i.HostedZoneIdMarker != nil { idx := strings.LastIndex(*i.HostedZoneIdMarker, `/`) v := (*i.HostedZoneIdMarker)[idx+1:] i.HostedZoneIdMarker = &v } case *ListVPCAssociationAuthorizationsInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *TestDNSAnswerInput: if i.HostedZoneId != nil { idx := strings.LastIndex(*i.HostedZoneId, `/`) v := (*i.HostedZoneId)[idx+1:] i.HostedZoneId = &v } case *UpdateHostedZoneCommentInput: if i.Id != nil { idx := strings.LastIndex(*i.Id, `/`) v := (*i.Id)[idx+1:] i.Id = &v } default: break } return nil } 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) }
682
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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 route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Activates a key-signing key (KSK) so that it can be used for signing by DNSSEC. // This operation changes the KSK status to ACTIVE . func (c *Client) ActivateKeySigningKey(ctx context.Context, params *ActivateKeySigningKeyInput, optFns ...func(*Options)) (*ActivateKeySigningKeyOutput, error) { if params == nil { params = &ActivateKeySigningKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "ActivateKeySigningKey", params, optFns, c.addOperationActivateKeySigningKeyMiddlewares) if err != nil { return nil, err } out := result.(*ActivateKeySigningKeyOutput) out.ResultMetadata = metadata return out, nil } type ActivateKeySigningKeyInput struct { // A unique string used to identify a hosted zone. // // This member is required. HostedZoneId *string // A string used to identify a key-signing key (KSK). Name can include numbers, // letters, and underscores (_). Name must be unique for each key-signing key in // the same hosted zone. // // This member is required. Name *string noSmithyDocumentSerde } type ActivateKeySigningKeyOutput struct { // A complex type that describes change information about changes made to your // hosted zone. // // This member is required. ChangeInfo *types.ChangeInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationActivateKeySigningKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpActivateKeySigningKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpActivateKeySigningKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpActivateKeySigningKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opActivateKeySigningKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opActivateKeySigningKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "ActivateKeySigningKey", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates an Amazon VPC with a private hosted zone. To perform the // association, the VPC and the private hosted zone must already exist. You can't // convert a public hosted zone into a private hosted zone. If you want to // associate a VPC that was created by using one Amazon Web Services account with a // private hosted zone that was created by using a different account, the Amazon // Web Services account that created the private hosted zone must first submit a // CreateVPCAssociationAuthorization request. Then the account that created the VPC // must submit an AssociateVPCWithHostedZone request. When granting access, the // hosted zone and the Amazon VPC must belong to the same partition. A partition is // a group of Amazon Web Services Regions. Each Amazon Web Services account is // scoped to one partition. The following are the supported partitions: // - aws - Amazon Web Services Regions // - aws-cn - China Regions // - aws-us-gov - Amazon Web Services GovCloud (US) Region // // For more information, see Access Management (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. func (c *Client) AssociateVPCWithHostedZone(ctx context.Context, params *AssociateVPCWithHostedZoneInput, optFns ...func(*Options)) (*AssociateVPCWithHostedZoneOutput, error) { if params == nil { params = &AssociateVPCWithHostedZoneInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateVPCWithHostedZone", params, optFns, c.addOperationAssociateVPCWithHostedZoneMiddlewares) if err != nil { return nil, err } out := result.(*AssociateVPCWithHostedZoneOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains information about the request to associate a VPC // with a private hosted zone. type AssociateVPCWithHostedZoneInput struct { // The ID of the private hosted zone that you want to associate an Amazon VPC // with. Note that you can't associate a VPC with a hosted zone that doesn't have // an existing VPC association. // // This member is required. HostedZoneId *string // A complex type that contains information about the VPC that you want to // associate with a private hosted zone. // // This member is required. VPC *types.VPC // Optional: A comment about the association request. Comment *string noSmithyDocumentSerde } // A complex type that contains the response information for the // AssociateVPCWithHostedZone request. type AssociateVPCWithHostedZoneOutput struct { // A complex type that describes the changes made to your hosted zone. // // This member is required. ChangeInfo *types.ChangeInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateVPCWithHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpAssociateVPCWithHostedZone{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpAssociateVPCWithHostedZone{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateVPCWithHostedZoneValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateVPCWithHostedZone(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAssociateVPCWithHostedZone(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "AssociateVPCWithHostedZone", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates, changes, or deletes CIDR blocks within a collection. Contains // authoritative IP information mapping blocks to one or multiple locations. A // change request can update multiple locations in a collection at a time, which is // helpful if you want to move one or more CIDR blocks from one location to another // in one transaction, without downtime. Limits The max number of CIDR blocks // included in the request is 1000. As a result, big updates require multiple API // calls. PUT and DELETE_IF_EXISTS Use ChangeCidrCollection to perform the // following actions: // - PUT : Create a CIDR block within the specified collection. // - DELETE_IF_EXISTS : Delete an existing CIDR block from the collection. func (c *Client) ChangeCidrCollection(ctx context.Context, params *ChangeCidrCollectionInput, optFns ...func(*Options)) (*ChangeCidrCollectionOutput, error) { if params == nil { params = &ChangeCidrCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "ChangeCidrCollection", params, optFns, c.addOperationChangeCidrCollectionMiddlewares) if err != nil { return nil, err } out := result.(*ChangeCidrCollectionOutput) out.ResultMetadata = metadata return out, nil } type ChangeCidrCollectionInput struct { // Information about changes to a CIDR collection. // // This member is required. Changes []types.CidrCollectionChange // The UUID of the CIDR collection to update. // // This member is required. Id *string // A sequential counter that Amazon Route 53 sets to 1 when you create a // collection and increments it by 1 each time you update the collection. We // recommend that you use ListCidrCollection to get the current value of // CollectionVersion for the collection that you want to update, and then include // that value with the change request. This prevents Route 53 from overwriting an // intervening update: // - If the value in the request matches the value of CollectionVersion in the // collection, Route 53 updates the collection. // - If the value of CollectionVersion in the collection is greater than the // value in the request, the collection was changed after you got the version // number. Route 53 does not update the collection, and it returns a // CidrCollectionVersionMismatch error. CollectionVersion *int64 noSmithyDocumentSerde } type ChangeCidrCollectionOutput struct { // The ID that is returned by ChangeCidrCollection . You can use it as input to // GetChange to see if a CIDR collection change has propagated or not. // // This member is required. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationChangeCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpChangeCidrCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpChangeCidrCollection{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpChangeCidrCollectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeCidrCollection(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opChangeCidrCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "ChangeCidrCollection", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" route53cust "github.com/aws/aws-sdk-go-v2/service/route53/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates, changes, or deletes a resource record set, which contains // authoritative DNS information for a specified domain name or subdomain name. For // example, you can use ChangeResourceRecordSets to create a resource record set // that routes traffic for test.example.com to a web server that has an IP address // of 192.0.2.44. Deleting Resource Record Sets To delete a resource record set, // you must specify all the same values that you specified when you created it. // Change Batches and Transactional Changes The request body must include a // document with a ChangeResourceRecordSetsRequest element. The request body // contains a list of change items, known as a change batch. Change batches are // considered transactional changes. Route 53 validates the changes in the request // and then either makes all or none of the changes in the change batch request. // This ensures that DNS routing isn't adversely affected by partial changes to the // resource record sets in a hosted zone. For example, suppose a change batch // request contains two changes: it deletes the CNAME resource record set for // www.example.com and creates an alias resource record set for www.example.com. If // validation for both records succeeds, Route 53 deletes the first resource record // set and creates the second resource record set in a single operation. If // validation for either the DELETE or the CREATE action fails, then the request // is canceled, and the original CNAME record continues to exist. If you try to // delete the same resource record set more than once in a single change batch, // Route 53 returns an InvalidChangeBatch error. Traffic Flow To create resource // record sets for complex routing configurations, use either the traffic flow // visual editor in the Route 53 console or the API actions for traffic policies // and traffic policy instances. Save the configuration as a traffic policy, then // associate the traffic policy with one or more domain names (such as example.com) // or subdomain names (such as www.example.com), in the same hosted zone or in // multiple hosted zones. You can roll back the updates if the new configuration // isn't performing as expected. For more information, see Using Traffic Flow to // Route DNS Traffic (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/traffic-flow.html) // in the Amazon Route 53 Developer Guide. Create, Delete, and Upsert Use // ChangeResourceRecordsSetsRequest to perform the following actions: // - CREATE : Creates a resource record set that has the specified values. // - DELETE : Deletes an existing resource record set that has the specified // values. // - UPSERT : If a resource set exists Route 53 updates it with the values in the // request. // // Syntaxes for Creating, Updating, and Deleting Resource Record Sets The syntax // for a request depends on the type of resource record set that you want to // create, delete, or update, such as weighted, alias, or failover. The XML // elements in your request must appear in the order listed in the syntax. For an // example for each type of resource record set, see "Examples." Don't refer to the // syntax in the "Parameter Syntax" section, which includes all of the elements for // every kind of resource record set that you can create, delete, or update by // using ChangeResourceRecordSets . Change Propagation to Route 53 DNS Servers When // you submit a ChangeResourceRecordSets request, Route 53 propagates your changes // to all of the Route 53 authoritative DNS servers. While your changes are // propagating, GetChange returns a status of PENDING . When propagation is // complete, GetChange returns a status of INSYNC . Changes generally propagate to // all Route 53 name servers within 60 seconds. For more information, see GetChange (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html) // . Limits on ChangeResourceRecordSets Requests For information about the limits // on a ChangeResourceRecordSets request, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) // in the Amazon Route 53 Developer Guide. func (c *Client) ChangeResourceRecordSets(ctx context.Context, params *ChangeResourceRecordSetsInput, optFns ...func(*Options)) (*ChangeResourceRecordSetsOutput, error) { if params == nil { params = &ChangeResourceRecordSetsInput{} } result, metadata, err := c.invokeOperation(ctx, "ChangeResourceRecordSets", params, optFns, c.addOperationChangeResourceRecordSetsMiddlewares) if err != nil { return nil, err } out := result.(*ChangeResourceRecordSetsOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains change information for the resource record set. type ChangeResourceRecordSetsInput struct { // A complex type that contains an optional comment and the Changes element. // // This member is required. ChangeBatch *types.ChangeBatch // The ID of the hosted zone that contains the resource record sets that you want // to change. // // This member is required. HostedZoneId *string noSmithyDocumentSerde } // A complex type containing the response for the request. type ChangeResourceRecordSetsOutput struct { // A complex type that contains information about changes made to your hosted // zone. This element contains an ID that you use when performing a GetChange (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html) // action to get detailed information about the change. // // This member is required. ChangeInfo *types.ChangeInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationChangeResourceRecordSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpChangeResourceRecordSets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpChangeResourceRecordSets{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpChangeResourceRecordSetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeResourceRecordSets(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = route53cust.HandleCustomErrorDeserialization(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opChangeResourceRecordSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "ChangeResourceRecordSets", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds, edits, or deletes tags for a health check or a hosted zone. For // information about using tags for cost allocation, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) // in the Billing and Cost Management User Guide. func (c *Client) ChangeTagsForResource(ctx context.Context, params *ChangeTagsForResourceInput, optFns ...func(*Options)) (*ChangeTagsForResourceOutput, error) { if params == nil { params = &ChangeTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ChangeTagsForResource", params, optFns, c.addOperationChangeTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ChangeTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains information about the tags that you want to add, // edit, or delete. type ChangeTagsForResourceInput struct { // The ID of the resource for which you want to add, change, or delete tags. // // This member is required. ResourceId *string // The type of the resource. // - The resource type for health checks is healthcheck . // - The resource type for hosted zones is hostedzone . // // This member is required. ResourceType types.TagResourceType // A complex type that contains a list of the tags that you want to add to the // specified health check or hosted zone and/or the tags that you want to edit // Value for. You can add a maximum of 10 tags to a health check or a hosted zone. AddTags []types.Tag // A complex type that contains a list of the tags that you want to delete from // the specified health check or hosted zone. You can specify up to 10 keys. RemoveTagKeys []string noSmithyDocumentSerde } // Empty response for the request. type ChangeTagsForResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationChangeTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpChangeTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpChangeTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpChangeTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opChangeTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "ChangeTagsForResource", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a CIDR collection in the current Amazon Web Services account. func (c *Client) CreateCidrCollection(ctx context.Context, params *CreateCidrCollectionInput, optFns ...func(*Options)) (*CreateCidrCollectionOutput, error) { if params == nil { params = &CreateCidrCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCidrCollection", params, optFns, c.addOperationCreateCidrCollectionMiddlewares) if err != nil { return nil, err } out := result.(*CreateCidrCollectionOutput) out.ResultMetadata = metadata return out, nil } type CreateCidrCollectionInput struct { // A client-specific token that allows requests to be securely retried so that the // intended outcome will only occur once, retries receive a similar response, and // there are no additional edge cases to handle. // // This member is required. CallerReference *string // A unique identifier for the account that can be used to reference the // collection from other API calls. // // This member is required. Name *string noSmithyDocumentSerde } type CreateCidrCollectionOutput struct { // A complex type that contains information about the CIDR collection. Collection *types.CidrCollection // A unique URL that represents the location for the CIDR collection. Location *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateCidrCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateCidrCollection{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateCidrCollectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCidrCollection(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateCidrCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateCidrCollection", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new health check. For information about adding health checks to // resource record sets, see HealthCheckId (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html#Route53-Type-ResourceRecordSet-HealthCheckId) // in ChangeResourceRecordSets (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html) // . ELB Load Balancers If you're registering EC2 instances with an Elastic Load // Balancing (ELB) load balancer, do not create Amazon Route 53 health checks for // the EC2 instances. When you register an EC2 instance with a load balancer, you // configure settings for an ELB health check, which performs a similar function to // a Route 53 health check. Private Hosted Zones You can associate health checks // with failover resource record sets in a private hosted zone. Note the following: // // - Route 53 health checkers are outside the VPC. To check the health of an // endpoint within a VPC by IP address, you must assign a public IP address to the // instance in the VPC. // - You can configure a health checker to check the health of an external // resource that the instance relies on, such as a database server. // - You can create a CloudWatch metric, associate an alarm with the metric, and // then create a health check that is based on the state of the alarm. For example, // you might create a CloudWatch metric that checks the status of the Amazon EC2 // StatusCheckFailed metric, add an alarm to the metric, and then create a health // check that is based on the state of the alarm. For information about creating // CloudWatch metrics and alarms by using the CloudWatch console, see the Amazon // CloudWatch User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatch.html) // . func (c *Client) CreateHealthCheck(ctx context.Context, params *CreateHealthCheckInput, optFns ...func(*Options)) (*CreateHealthCheckOutput, error) { if params == nil { params = &CreateHealthCheckInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHealthCheck", params, optFns, c.addOperationCreateHealthCheckMiddlewares) if err != nil { return nil, err } out := result.(*CreateHealthCheckOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains the health check request information. type CreateHealthCheckInput struct { // A unique string that identifies the request and that allows you to retry a // failed CreateHealthCheck request without the risk of creating two identical // health checks: // - If you send a CreateHealthCheck request with the same CallerReference and // settings as a previous request, and if the health check doesn't exist, Amazon // Route 53 creates the health check. If the health check does exist, Route 53 // returns the settings for the existing health check. // - If you send a CreateHealthCheck request with the same CallerReference as a // deleted health check, regardless of the settings, Route 53 returns a // HealthCheckAlreadyExists error. // - If you send a CreateHealthCheck request with the same CallerReference as an // existing health check but with different settings, Route 53 returns a // HealthCheckAlreadyExists error. // - If you send a CreateHealthCheck request with a unique CallerReference but // settings identical to an existing health check, Route 53 creates the health // check. // // This member is required. CallerReference *string // A complex type that contains settings for a new health check. // // This member is required. HealthCheckConfig *types.HealthCheckConfig noSmithyDocumentSerde } // A complex type containing the response information for the new health check. type CreateHealthCheckOutput struct { // A complex type that contains identifying information about the health check. // // This member is required. HealthCheck *types.HealthCheck // The unique URL representing the new health check. // // This member is required. Location *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateHealthCheck{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateHealthCheck{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHealthCheckValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHealthCheck(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateHealthCheck", } }
176
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new public or private hosted zone. You create records in a public // hosted zone to define how you want to route traffic on the internet for a // domain, such as example.com, and its subdomains (apex.example.com, // acme.example.com). You create records in a private hosted zone to define how you // want to route traffic for a domain and its subdomains within one or more Amazon // Virtual Private Clouds (Amazon VPCs). You can't convert a public hosted zone to // a private hosted zone or vice versa. Instead, you must create a new hosted zone // with the same name and create new resource record sets. For more information // about charges for hosted zones, see Amazon Route 53 Pricing (http://aws.amazon.com/route53/pricing/) // . Note the following: // - You can't create a hosted zone for a top-level domain (TLD) such as .com. // - For public hosted zones, Route 53 automatically creates a default SOA // record and four NS records for the zone. For more information about SOA and NS // records, see NS and SOA Records that Route 53 Creates for a Hosted Zone (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html) // in the Amazon Route 53 Developer Guide. If you want to use the same name servers // for multiple public hosted zones, you can optionally associate a reusable // delegation set with the hosted zone. See the DelegationSetId element. // - If your domain is registered with a registrar other than Route 53, you must // update the name servers with your registrar to make Route 53 the DNS service for // the domain. For more information, see Migrating DNS Service for an Existing // Domain to Amazon Route 53 (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html) // in the Amazon Route 53 Developer Guide. // // When you submit a CreateHostedZone request, the initial status of the hosted // zone is PENDING . For public hosted zones, this means that the NS and SOA // records are not yet available on all Route 53 DNS servers. When the NS and SOA // records are available, the status of the zone changes to INSYNC . The // CreateHostedZone request requires the caller to have an ec2:DescribeVpcs // permission. When creating private hosted zones, the Amazon VPC must belong to // the same partition where the hosted zone is created. A partition is a group of // Amazon Web Services Regions. Each Amazon Web Services account is scoped to one // partition. The following are the supported partitions: // - aws - Amazon Web Services Regions // - aws-cn - China Regions // - aws-us-gov - Amazon Web Services GovCloud (US) Region // // For more information, see Access Management (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. func (c *Client) CreateHostedZone(ctx context.Context, params *CreateHostedZoneInput, optFns ...func(*Options)) (*CreateHostedZoneOutput, error) { if params == nil { params = &CreateHostedZoneInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHostedZone", params, optFns, c.addOperationCreateHostedZoneMiddlewares) if err != nil { return nil, err } out := result.(*CreateHostedZoneOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains information about the request to create a public // or private hosted zone. type CreateHostedZoneInput struct { // A unique string that identifies the request and that allows failed // CreateHostedZone requests to be retried without the risk of executing the // operation twice. You must use a unique CallerReference string every time you // submit a CreateHostedZone request. CallerReference can be any unique string, // for example, a date/time stamp. // // This member is required. CallerReference *string // The name of the domain. Specify a fully qualified domain name, for example, // www.example.com. The trailing dot is optional; Amazon Route 53 assumes that the // domain name is fully qualified. This means that Route 53 treats www.example.com // (without a trailing dot) and www.example.com. (with a trailing dot) as // identical. If you're creating a public hosted zone, this is the name you have // registered with your DNS registrar. If your domain name is registered with a // registrar other than Route 53, change the name servers for your domain to the // set of NameServers that CreateHostedZone returns in DelegationSet . // // This member is required. Name *string // If you want to associate a reusable delegation set with this hosted zone, the // ID that Amazon Route 53 assigned to the reusable delegation set when you created // it. For more information about reusable delegation sets, see // CreateReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html) // . DelegationSetId *string // (Optional) A complex type that contains the following optional values: // - For public and private hosted zones, an optional comment // - For private hosted zones, an optional PrivateZone element // If you don't specify a comment or the PrivateZone element, omit HostedZoneConfig // and the other elements. HostedZoneConfig *types.HostedZoneConfig // (Private hosted zones only) A complex type that contains information about the // Amazon VPC that you're associating with this hosted zone. You can specify only // one Amazon VPC when you create a private hosted zone. If you are associating a // VPC with a hosted zone with this request, the paramaters VPCId and VPCRegion // are also required. To associate additional Amazon VPCs with the hosted zone, use // AssociateVPCWithHostedZone (https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html) // after you create a hosted zone. VPC *types.VPC noSmithyDocumentSerde } // A complex type containing the response information for the hosted zone. type CreateHostedZoneOutput struct { // A complex type that contains information about the CreateHostedZone request. // // This member is required. ChangeInfo *types.ChangeInfo // A complex type that describes the name servers for this hosted zone. // // This member is required. DelegationSet *types.DelegationSet // A complex type that contains general information about the hosted zone. // // This member is required. HostedZone *types.HostedZone // The unique URL representing the new hosted zone. // // This member is required. Location *string // A complex type that contains information about an Amazon VPC that you // associated with this hosted zone. VPC *types.VPC // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateHostedZone{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateHostedZone{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHostedZoneValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHostedZone(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateHostedZone(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateHostedZone", } }
228
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new key-signing key (KSK) associated with a hosted zone. You can only // have two KSKs per hosted zone. func (c *Client) CreateKeySigningKey(ctx context.Context, params *CreateKeySigningKeyInput, optFns ...func(*Options)) (*CreateKeySigningKeyOutput, error) { if params == nil { params = &CreateKeySigningKeyInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateKeySigningKey", params, optFns, c.addOperationCreateKeySigningKeyMiddlewares) if err != nil { return nil, err } out := result.(*CreateKeySigningKeyOutput) out.ResultMetadata = metadata return out, nil } type CreateKeySigningKeyInput struct { // A unique string that identifies the request. // // This member is required. CallerReference *string // The unique string (ID) used to identify a hosted zone. // // This member is required. HostedZoneId *string // The Amazon resource name (ARN) for a customer managed key in Key Management // Service (KMS). The KeyManagementServiceArn must be unique for each key-signing // key (KSK) in a single hosted zone. To see an example of KeyManagementServiceArn // that grants the correct permissions for DNSSEC, scroll down to Example. You must // configure the customer managed customer managed key as follows: Status Enabled // Key spec ECC_NIST_P256 Key usage Sign and verify Key policy The key policy must // give permission for the following actions: // - DescribeKey // - GetPublicKey // - Sign // The key policy must also include the Amazon Route 53 service in the principal // for your account. Specify the following: // - "Service": "dnssec-route53.amazonaws.com" // For more information about working with a customer managed key in KMS, see Key // Management Service concepts (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html) // . // // This member is required. KeyManagementServiceArn *string // A string used to identify a key-signing key (KSK). Name can include numbers, // letters, and underscores (_). Name must be unique for each key-signing key in // the same hosted zone. // // This member is required. Name *string // A string specifying the initial status of the key-signing key (KSK). You can // set the value to ACTIVE or INACTIVE . // // This member is required. Status *string noSmithyDocumentSerde } type CreateKeySigningKeyOutput struct { // A complex type that describes change information about changes made to your // hosted zone. // // This member is required. ChangeInfo *types.ChangeInfo // The key-signing key (KSK) that the request creates. // // This member is required. KeySigningKey *types.KeySigningKey // The unique URL representing the new key-signing key (KSK). // // This member is required. Location *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateKeySigningKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateKeySigningKey{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateKeySigningKey{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateKeySigningKeyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateKeySigningKey(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateKeySigningKey(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateKeySigningKey", } }
180
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a configuration for DNS query logging. After you create a query logging // configuration, Amazon Route 53 begins to publish log data to an Amazon // CloudWatch Logs log group. DNS query logs contain information about the queries // that Route 53 receives for a specified public hosted zone, such as the // following: // - Route 53 edge location that responded to the DNS query // - Domain or subdomain that was requested // - DNS record type, such as A or AAAA // - DNS response code, such as NoError or ServFail // // Log Group and Resource Policy Before you create a query logging configuration, // perform the following operations. If you create a query logging configuration // using the Route 53 console, Route 53 performs these operations automatically. // - Create a CloudWatch Logs log group, and make note of the ARN, which you // specify when you create a query logging configuration. Note the following: // - You must create the log group in the us-east-1 region. // - You must use the same Amazon Web Services account to create the log group // and the hosted zone that you want to configure query logging for. // - When you create log groups for query logging, we recommend that you use a // consistent prefix, for example: /aws/route53/hosted zone name In the next // step, you'll create a resource policy, which controls access to one or more log // groups and the associated Amazon Web Services resources, such as Route 53 hosted // zones. There's a limit on the number of resource policies that you can create, // so we recommend that you use a consistent prefix so you can use the same // resource policy for all the log groups that you create for query logging. // - Create a CloudWatch Logs resource policy, and give it the permissions that // Route 53 needs to create log streams and to send query logs to log streams. For // the value of Resource , specify the ARN for the log group that you created in // the previous step. To use the same resource policy for all the CloudWatch Logs // log groups that you created for query logging configurations, replace the hosted // zone name with * , for example: // arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* To avoid the // confused deputy problem, a security issue where an entity without a permission // for an action can coerce a more-privileged entity to perform it, you can // optionally limit the permissions that a service has to a resource in a // resource-based policy by supplying the following values: // - For aws:SourceArn , supply the hosted zone ARN used in creating the query // logging configuration. For example, aws:SourceArn: // arn:aws:route53:::hostedzone/hosted zone ID . // - For aws:SourceAccount , supply the account ID for the account that creates // the query logging configuration. For example, aws:SourceAccount:111111111111 . // For more information, see The confused deputy problem (https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html) // in the Amazon Web Services IAM User Guide. You can't use the CloudWatch console // to create or edit a resource policy. You must use the CloudWatch API, one of the // Amazon Web Services SDKs, or the CLI. // // Log Streams and Edge Locations When Route 53 finishes creating the // configuration for DNS query logging, it does the following: // - Creates a log stream for an edge location the first time that the edge // location responds to DNS queries for the specified hosted zone. That log stream // is used to log all queries that Route 53 responds to for that edge location. // - Begins to send query logs to the applicable log stream. // // The name of each log stream is in the following format: hosted zone ID/edge // location code The edge location code is a three-letter code and an arbitrarily // assigned number, for example, DFW3. The three-letter code typically corresponds // with the International Air Transport Association airport code for an airport // near the edge location. (These abbreviations might change in the future.) For a // list of edge locations, see "The Route 53 Global Network" on the Route 53 // Product Details (http://aws.amazon.com/route53/details/) page. Queries That Are // Logged Query logs contain only the queries that DNS resolvers forward to Route // 53. If a DNS resolver has already cached the response to a query (such as the IP // address for a load balancer for example.com), the resolver will continue to // return the cached response. It doesn't forward another query to Route 53 until // the TTL for the corresponding resource record set expires. Depending on how many // DNS queries are submitted for a resource record set, and depending on the TTL // for that resource record set, query logs might contain information about only // one query out of every several thousand queries that are submitted to DNS. For // more information about how DNS works, see Routing Internet Traffic to Your // Website or Web Application (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html) // in the Amazon Route 53 Developer Guide. Log File Format For a list of the values // in each query log and the format of each value, see Logging DNS Queries (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html) // in the Amazon Route 53 Developer Guide. Pricing For information about charges // for query logs, see Amazon CloudWatch Pricing (http://aws.amazon.com/cloudwatch/pricing/) // . How to Stop Logging If you want Route 53 to stop sending query logs to // CloudWatch Logs, delete the query logging configuration. For more information, // see DeleteQueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteQueryLoggingConfig.html) // . func (c *Client) CreateQueryLoggingConfig(ctx context.Context, params *CreateQueryLoggingConfigInput, optFns ...func(*Options)) (*CreateQueryLoggingConfigOutput, error) { if params == nil { params = &CreateQueryLoggingConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateQueryLoggingConfig", params, optFns, c.addOperationCreateQueryLoggingConfigMiddlewares) if err != nil { return nil, err } out := result.(*CreateQueryLoggingConfigOutput) out.ResultMetadata = metadata return out, nil } type CreateQueryLoggingConfigInput struct { // The Amazon Resource Name (ARN) for the log group that you want to Amazon Route // 53 to send query logs to. This is the format of the ARN: // arn:aws:logs:region:account-id:log-group:log_group_name To get the ARN for a log // group, you can use the CloudWatch console, the DescribeLogGroups (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html) // API action, the describe-log-groups (https://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html) // command, or the applicable command in one of the Amazon Web Services SDKs. // // This member is required. CloudWatchLogsLogGroupArn *string // The ID of the hosted zone that you want to log queries for. You can log queries // only for public hosted zones. // // This member is required. HostedZoneId *string noSmithyDocumentSerde } type CreateQueryLoggingConfigOutput struct { // The unique URL representing the new query logging configuration. // // This member is required. Location *string // A complex type that contains the ID for a query logging configuration, the ID // of the hosted zone that you want to log queries for, and the ARN for the log // group that you want Amazon Route 53 to send query logs to. // // This member is required. QueryLoggingConfig *types.QueryLoggingConfig // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateQueryLoggingConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateQueryLoggingConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateQueryLoggingConfig{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateQueryLoggingConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQueryLoggingConfig(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateQueryLoggingConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateQueryLoggingConfig", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a delegation set (a group of four name servers) that can be reused by // multiple hosted zones that were created by the same Amazon Web Services account. // You can also create a reusable delegation set that uses the four name servers // that are associated with an existing hosted zone. Specify the hosted zone ID in // the CreateReusableDelegationSet request. You can't associate a reusable // delegation set with a private hosted zone. For information about using a // reusable delegation set to configure white label name servers, see Configuring // White Label Name Servers (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/white-label-name-servers.html) // . The process for migrating existing hosted zones to use a reusable delegation // set is comparable to the process for configuring white label name servers. You // need to perform the following steps: // - Create a reusable delegation set. // - Recreate hosted zones, and reduce the TTL to 60 seconds or less. // - Recreate resource record sets in the new hosted zones. // - Change the registrar's name servers to use the name servers for the new // hosted zones. // - Monitor traffic for the website or application. // - Change TTLs back to their original values. // // If you want to migrate existing hosted zones to use a reusable delegation set, // the existing hosted zones can't use any of the name servers that are assigned to // the reusable delegation set. If one or more hosted zones do use one or more name // servers that are assigned to the reusable delegation set, you can do one of the // following: // - For small numbers of hosted zones—up to a few hundred—it's relatively easy // to create reusable delegation sets until you get one that has four name servers // that don't overlap with any of the name servers in your hosted zones. // - For larger numbers of hosted zones, the easiest solution is to use more // than one reusable delegation set. // - For larger numbers of hosted zones, you can also migrate hosted zones that // have overlapping name servers to hosted zones that don't have overlapping name // servers, then migrate the hosted zones again to use the reusable delegation set. func (c *Client) CreateReusableDelegationSet(ctx context.Context, params *CreateReusableDelegationSetInput, optFns ...func(*Options)) (*CreateReusableDelegationSetOutput, error) { if params == nil { params = &CreateReusableDelegationSetInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateReusableDelegationSet", params, optFns, c.addOperationCreateReusableDelegationSetMiddlewares) if err != nil { return nil, err } out := result.(*CreateReusableDelegationSetOutput) out.ResultMetadata = metadata return out, nil } type CreateReusableDelegationSetInput struct { // A unique string that identifies the request, and that allows you to retry // failed CreateReusableDelegationSet requests without the risk of executing the // operation twice. You must use a unique CallerReference string every time you // submit a CreateReusableDelegationSet request. CallerReference can be any unique // string, for example a date/time stamp. // // This member is required. CallerReference *string // If you want to mark the delegation set for an existing hosted zone as reusable, // the ID for that hosted zone. HostedZoneId *string noSmithyDocumentSerde } type CreateReusableDelegationSetOutput struct { // A complex type that contains name server information. // // This member is required. DelegationSet *types.DelegationSet // The unique URL representing the new reusable delegation set. // // This member is required. Location *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateReusableDelegationSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateReusableDelegationSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateReusableDelegationSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateReusableDelegationSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReusableDelegationSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateReusableDelegationSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateReusableDelegationSet", } }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a traffic policy, which you use to create multiple DNS resource record // sets for one domain name (such as example.com) or one subdomain name (such as // www.example.com). func (c *Client) CreateTrafficPolicy(ctx context.Context, params *CreateTrafficPolicyInput, optFns ...func(*Options)) (*CreateTrafficPolicyOutput, error) { if params == nil { params = &CreateTrafficPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateTrafficPolicy", params, optFns, c.addOperationCreateTrafficPolicyMiddlewares) if err != nil { return nil, err } out := result.(*CreateTrafficPolicyOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains information about the traffic policy that you want // to create. type CreateTrafficPolicyInput struct { // The definition of this traffic policy in JSON format. For more information, see // Traffic Policy Document Format (https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html) // . // // This member is required. Document *string // The name of the traffic policy. // // This member is required. Name *string // (Optional) Any comments that you want to include about the traffic policy. Comment *string noSmithyDocumentSerde } // A complex type that contains the response information for the // CreateTrafficPolicy request. type CreateTrafficPolicyOutput struct { // A unique URL that represents a new traffic policy. // // This member is required. Location *string // A complex type that contains settings for the new traffic policy. // // This member is required. TrafficPolicy *types.TrafficPolicy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateTrafficPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateTrafficPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateTrafficPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateTrafficPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateTrafficPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateTrafficPolicy", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53 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/route53/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates resource record sets in a specified hosted zone based on the settings // in a specified traffic policy version. In addition, CreateTrafficPolicyInstance // associates the resource record sets with a specified domain name (such as // example.com) or subdomain name (such as www.example.com). Amazon Route 53 // responds to DNS queries for the domain or subdomain name by using the resource // record sets that CreateTrafficPolicyInstance created. func (c *Client) CreateTrafficPolicyInstance(ctx context.Context, params *CreateTrafficPolicyInstanceInput, optFns ...func(*Options)) (*CreateTrafficPolicyInstanceOutput, error) { if params == nil { params = &CreateTrafficPolicyInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateTrafficPolicyInstance", params, optFns, c.addOperationCreateTrafficPolicyInstanceMiddlewares) if err != nil { return nil, err } out := result.(*CreateTrafficPolicyInstanceOutput) out.ResultMetadata = metadata return out, nil } // A complex type that contains information about the resource record sets that // you want to create based on a specified traffic policy. type CreateTrafficPolicyInstanceInput struct { // The ID of the hosted zone that you want Amazon Route 53 to create resource // record sets in by using the configuration in a traffic policy. // // This member is required. HostedZoneId *string // The domain name (such as example.com) or subdomain name (such as // www.example.com) for which Amazon Route 53 responds to DNS queries by using the // resource record sets that Route 53 creates for this traffic policy instance. // // This member is required. Name *string // (Optional) The TTL that you want Amazon Route 53 to assign to all of the // resource record sets that it creates in the specified hosted zone. // // This member is required. TTL *int64 // The ID of the traffic policy that you want to use to create resource record // sets in the specified hosted zone. // // This member is required. TrafficPolicyId *string // The version of the traffic policy that you want to use to create resource // record sets in the specified hosted zone. // // This member is required. TrafficPolicyVersion *int32 noSmithyDocumentSerde } // A complex type that contains the response information for the // CreateTrafficPolicyInstance request. type CreateTrafficPolicyInstanceOutput struct { // A unique URL that represents a new traffic policy instance. // // This member is required. Location *string // A complex type that contains settings for the new traffic policy instance. // // This member is required. TrafficPolicyInstance *types.TrafficPolicyInstance // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateTrafficPolicyInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestxml_serializeOpCreateTrafficPolicyInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateTrafficPolicyInstance{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateTrafficPolicyInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficPolicyInstance(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addSanitizeURLMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateTrafficPolicyInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53", OperationName: "CreateTrafficPolicyInstance", } }
170